Chapter 13 Creating User Interfaces
1. JComponent 类
可以为JComponent类增加边框:setBorder(Border)
如messagePanel.setBorder(new TitleBorder("Display Message"));
java.awt.Component的accessor和mutator:
(set/get)Font,Background,Foreground,PreferredSize
(is/set)visible
java.awt.Container:
add(Component)
add(Component, int index)
remove(Component)
(set/get)Layout
paintComponent
javax.swing.JComponent:
(set/get)ToolTipTest,Border
注:尽管JComponent是Container的子类,但一般不把按钮等控间当作容器处理。
2. 控间命名惯例:
jbt jchk jrb jlbl jtf jta jcbo jlst jscb jsld
JButton JCheckBox JRadioButton JLabel JTestField JTextArea JComboBox JList JScrollBar JSlider
3. javax.swing.AbstractButton 类
(set/get) ActionCommand, Text, Icon, PressedIcon, RolloverIcon, Mnemonic, HorizontalAlignment, HorizontalTextPosition, VerticalAlighment, VerticalTestPosition, IconTestGap
(set/is) BorderPainted, Selected
JButton 类
JButton()
JButton(Icon)
JButton(String)
JButton(String, Icon)