Java Design Pattern
Introduction to Java 10
Introduction to Java 11
Introduction to Java 12

Java Swing Introduction

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 which 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 feel : Each swing component is rendered by java code rather than by native codes. The look and feel of a component is under the control of swing. That means it is possible to separate the look and feel of a component from the logic of the component.

AWT vs Swing:

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

About the Author

Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc