New Features in Swing Lightweight. Not built on native window-system windows Much bigger set of built-in controls. Trees, image buttons tabbed panes, sliders, toolbars, color choosers tables etc Much more customizable(可定制) Can change border, text alignment, or add image to almost any control
6 New Features in Swing • Lightweight. Not built on native window-system windows. • Much bigger set of built-in controls. Trees, image buttons, tabbed panes, sliders, toolbars, color choosers, tables, etc. • Much more customizable(可定制). Can change border, text alignment, or add image to almost any control
New Features in Swing Pluggable" look and feel. Can change look and feel at runtime or design own look and feel Many miscellaneous new features. Double buffering built in, tool tips, keyboard accelerators custom cursors. etc
7 New Features in Swing • Pluggable" look and feel. Can change look and feel at runtime, or design own look and feel. • Many miscellaneous new features. Doublebuffering built in, tool tips, keyboard accelerators, custom cursors, etc
AWT Components primitive r- Component Button Container \container canvas Checkbox Panel window 「 Choice Label Frame Dialog List Scrollbar ile Dialog Textcomponent javaaPplet Applet Textarea TextField
8 AWT Components primitive container
Swing Components JComponent」 JButton 恒E烈 儿 Sahel JPanel COmbo口x CHeckbOx H □ JApplet]翻頵癜鼬H JList JScrollbar Jframe JDialog JTextcomponent卜 Jwindow 「 JTextField「 JTextArea
9 Swing Components
Frame a Frame is a top -level window with a title and a border java. lang Object +----iavaawt component java. awt Container +-<-java awt window +----java awt Frame
10 Frame • A Frame is a top-level window with a title and a border