A tour of swing
For example, if you know that an application will be running only in a Windows environment, it is possible to specify the Windows look and feel. It is also possible to design a custom look and feel. Finally, the look and feel can be changed dynamically at run time.
Java SE 6 provides look-and-feels, such as metal and Motif, that are available to all Swing users. The metal look and feel is also called the Java look and feel. It is platform-independent and available in all Java execution environments. It is also the default look and feel. Windows environments also have access to the Windows and Windows Classic look and feel.
Swing also has the ability to replace these objects on-the-fly.
- => 100% Java implementation of components
- => Pluggable Look & Feel
- => Lightweight components
-
=> Uses MVC Architecture
~ Model represents the data
~ View as a visual representation of the data
~ Controller takes input and translates it to changes in data
-
~ Component set (subclasses of JComponent)
~ Support classes
~ Interfaces
In Swing, classes that represent GUI components have names beginning with the letter J. Some examples are JButton, JLabel, and JSlider. Altogether there are more than 250 new classes and 75 interfaces in Swing — twice as many as in AWT.