100% found this document useful (1 vote)
222 views4 pages

SWING - Java 2nd Lesson Notes

Swing is a GUI widget toolkit for Java that provides rich controls and follows an MVC architecture. It offers advantages over AWT like lightweight components, pluggable look and feel, and additional components like JTree and JTable. Swing components are platform independent and more flexible than AWT due to its implementation of the MVC pattern. The key differences between Swing and AWT are that Swing uses javax packages, provides more components, and supports pluggable look and feel while being lighter weight and following MVC.

Uploaded by

Yogiraj Jadhav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (1 vote)
222 views4 pages

SWING - Java 2nd Lesson Notes

Swing is a GUI widget toolkit for Java that provides rich controls and follows an MVC architecture. It offers advantages over AWT like lightweight components, pluggable look and feel, and additional components like JTree and JTable. Swing components are platform independent and more flexible than AWT due to its implementation of the MVC pattern. The key differences between Swing and AWT are that Swing uses javax packages, provides more components, and supports pluggable look and feel while being lighter weight and following MVC.

Uploaded by

Yogiraj Jadhav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

SWING

Swing is a GUI widget toolkit for java. It is part of Oracle’s Java Foundation
Classes (JFC)
- Hok AWT madhe apan kasa Button asa lihaycho tasa swing madhe JButton
Lihitat manje fakta “J” add kela jato sarting la…

Swing Features :
- 1. Light Weight
- 2. Rich Controls
- 3. Easy Mouseless Operations
- 4. Tolltips
- 5. Easy Scrolling
- 6. Pluggable Look and Feel
MVC Architecture :
- Swing components follow the MVC ( Model – View – Controller ) and
thus can provide a much more flexible UI
- MVC Features:
 The data access
 The business logic
 User Interaction

MVC :
 Model : this provides the means by which data is retrived and
manipulated.
 View : this represents the visual interface components of the
Graphical User Interface (GUI) application which interact with the
user
 Controller : this joins the MODEL & VIEW and is the heart of the
control logic by associating user-generated events with data actions.
Difference Between AWT & SWING :
Sr AWT Sr SWING
No No
1 AWT stands for Abstract 1 Swing is also called JFC’s
Windowing ToolKit (Java Foundation Classes)
2 AWT component require 2 Swing component require
java.awt package javax.swing package
3 Platform-Dependent Components 3 Platform-Independent
Components
4 Heavyweight 4 Lightweight

5 Does not Support Pluggable look 5 Supports Pluggable look & feel
& feel
6 Less components than swing 6 Swing provides more component

7 Does not follow MVC 7 Swing follows MVC

Advantages of Swing :
- Swing components are light weight
- Follows MVC thus it is more flexible UI
- Provides some additional components like :
 JTree
 JTable
 Tabbed Panes
 JScrollPane
 JToolTip
 JProgressBar
- Swing provides built-in double buffering

Disadvantages of Swing :
- It can be slower than AWT when you are not careful about
programming.
- Swing components might not behave exactly like native components
which look like native components.
- It requires Java 2 or separate JAR file.

You might also like