GUI Class Hierarchy (Swing) 4444444444444440444444 4444 44444444444 Dimension Classes in the java awt LayoutManager package Heavyweight Font FontMetrics Object Color Panel Applet JApplet Graphics Component Container Window Frame JFrame Dialog JDialog JComponen Swing GU阻件, Swing Components 例如:JButton、 in the javax.swing package JLabel、 444 JTextField Lightweight 轻量级
GUI Class Hierarchy (Swing) Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * 轻量级 Swing GUI组件, 例如:JButton、 JLabel、 JTextField
J Test.java 1eimport java.awt.*: 2 import javax.swing.*: 3 public class Test 4日 public static void main(String[]args) JButton jbtoK=new JButton("OK"); System.out.println(jbtOk instanceof JButton); 2 System.out.println(jbtOK instanceof JComponent); 8 System.out.println(jbtoK instanceof Container): System.out.println(jbtoK instanceof Component); 10 System.out.println(jbtok instanceof Object); 11 12 13 貝Console3 <terminated>Test [Java Application]C:(Program Files\Genui true true true true true
instanceof运算符判断一个对象是否目标类的实例
instanceof 运算符判断一个对象是否目标类的实例
Container Classes Dimension Classes in the java awt LayoutManager package Heavyweight Font 1 FontMetrics Object Color Panel Applet JApplet Graphics Component Container Window Frame JFrame Dialog JDialog 容器类是用于容纳其它组 JComponent JPanel Swing Components in the javax.swing package 件的组件。 Lightweight
Container Classes Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * JPanel 容器类是用于容纳其它组 件的组件
Motivations The design of the API for Java GUI programming is an excellent example of how the object-oriented principle is applied.In the chapters that follow,you will learn the framework of Java GUI API and use the GUI components to develop user-friendly interfaces for applications and applets
Motivations The design of the API for Java GUI programming is an excellent example of how the object-oriented principle is applied. In the chapters that follow, you will learn the framework of Java GUI API and use the GUI components to develop user-friendly interfaces for applications and applets