Java


Java Tutorial


Admission Enquiry Form

  

Java Swing

What is Java Swing ?

Java Swing is a part of Java Foundation Classes (JFC) library.It is an extension of Abstract Window Toolkit(AWT).Java Swing is used to create window-based applications.
Java Swing offers much improved functionality over AWT.Java Swing provides new,expanded, platform-independent and lightweight components.Java Swing provides better event handling and drag and drop support.
The javax.swing package provides classes such as JButton,JLabel,JFrame, JTextField, JTextArea, JRadioButton, JCheckbox, JMenu,JList,JTable, JSlider etc.Swing is the large UI package.

Features of Java Swing

1. Lightweight Components:

Swing components are independent of native Operating System's API as Swing API controls are rendered mostly using Java code instead of underlying operating system calls.In Swing most of the components have their own view supported by Java look and feel classes.

2. Pluggable Look and Feel:

The Swing library supports a cross-platform look and feel also called the Java look and feel that remains the same across all platforms wherever the program runs.

3. Advanced Controls:

Swing provides a rich set of advanced controls like Table, TabbedPane, slider, colorchooser, and Tree controls etc..

4. More Customizable:

Java Swing controls can be customized in a easy way as visual apperance is independent of internal representation

What is Java Foundation Classes(JFC) ?

The Java Foundation Classes (JFC) are a graphical framework for building portable Java-based graphical user interfaces (GUIs). JFC consists of the Abstract Window Toolkit (AWT), Swing and Java 2D,Drag and Drop and Accessibility API which include screen readers,screen magnifiers and speech recognition systems, which are useful for disabled people.

Java Swing Classes Hierarchy

Difference between Swing and AWT

S.No.Java AWTJava Swing
1.AWT components are heavyweight.Swing components are lightweight.
2.AWT having less components as compare to Swing.Swing having best components like table,tree,list,Radio button,dialog etc..
3.AWT components are platform-dependent.Swing components are platform-independent.
4.AWT does not follow MVC(Model View Controller).Swing follow MVC.