You are on page 1of 2

1.

Main New Features


O Lightweight. Not built on native window-system windows.
O uch bigger set oI built-in controls. Trees, image buttons, tabbed panes,
sliders, toolbars, color choosers, tables, text areas to display HTL or RTF,
etc.
O uch more customizable. Can change border, text alignment, or add image
to almost any control. Can customize how minor Ieatures are drawn. Can
separate internal representation Irom visual appearance.
O !luggable look and Ieel. Can change look and Ieel at runtime, or design
own look and Ieel.
O any miscellaneous new Ieatures. Double-buIIering built in, tool tips,
dockable tool bars, keyboard accelerators, custom cursors, etc.
. Swing is Standard in Java (aka Java 1.
O ncludes Java2D (see this tutorial).
O dds support Ior D, W', and other audio.
. Separate Swing package can be added to Java
1.1.
O Does not include Java2D or new audio Iormats.
O Download it here.
. Components are named J.
.g. JFrame, J!anel, Jpplet, JDialog, JButton, etc.
. There is an aImost-equivaIent Swing component
for most AWT components.
6. Do drawing in paintComponent, not paint.
7. Instead of adding components directIy to frames
or appIets, use the content pane
O dd to content pane via getContentPane().add
O Replace content pane via 8etContentPane
. ModeI-View-ControIIer architecture Iets you
change the internaI data representation for Iists,
trees, tabIes, etc.
9. Swing was in the com.sun.java.swing package in
beta reIeases of 1.. Switched to javax.swing in 1.
finaI.
10. DefauIt "Iook and feeI" is a Java-specific one.
O Need special call to get native look
O DeIault called Java look & Ieel (Iormerly etal)
11. Mixing AWT and Swing is doomed.
WT components are always on top, and z-ordering problems catch you in many
unexpected ways. Stick with the WT or move completely to Swing.

Java version | Java famiIy | AIso known as


Java v 1.0 | JDK |
Java v 1.1 | JDK |
Java v 1. | Java (JSE |
Java v 1. | Java (JSE |
Java v 1. | Java (JSE |
Java v .0 | Java (JSE | Java v. 1.
Java SE 6 | Java SE | Java v. 1.6

You might also like