Java Swing tutorial is a part of Java Foundation Classes (JFC) that is used to create window-based GUI applications. The Java Foundation Classes (JFC) are a set of GUI components that simplify the development of desktop applications. It is built on the foundation of AWT (Abstract Windowing Toolkit). Swing also uses the same event handling mechanism as the AWT. The javax.swing package provides classes for java swing API such as JButton, JTextField, JTextArea, JRadioButton, JCheckbox, JMenu, etc.

Two key Swing Features:

  1. Swing components are lightweight: Swing components are written entirely in java and do not map directly to platform-specific codes. Lightweight components are more flexible and more efficient. So each component will work in a consistent manner.
  2. Swing supports a pluggable look and feels: Each swing component is rendered by Java code rather than by native codes. The look and feel of a component are under the control of the swing. That means it is possible to separate the look and feel of a component from the logic of the component.

AWT vs Swing

JAVA AWT JAVA Swing
Java AWT components are platform dependent. Java Swing components are platform independent.
AWT components are heavyweight. Swing components are lightweight.
AWT does not support pluggable look and feel. Swing supports pluggable look and feel.
AWT does not follow MVC. Swing follow MVC (Model View Controller) where model represents data, view represents presentation and controller acts as an interface between model and view.
Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Data Science with Python Training | Projects

SILAN Technology, BBSR
Call to: 9439202111  |  9658317757  |  0674-2361252

Comment