SlideShare una empresa de Scribd logo
1 de 12
SWING & SWT
A Tale of Two Java GUI Libraries
AWT
          (ABSTRACT WINDOW TOOLKIT)
 Oldest toolkit , part of java standard API
 It includes classes like Button, TextField, and Menu

 It also provides the necessary event handling
  mechanism
 AWT controls may behave differently under different
  operating systems
For example, it might be possible to right-click on a
  button under operating system A showing a context
  menu, but impossible to do so under operating system
  B
   It relies on the native GUI elements of each
    operating systems so known as“Platform
    dependent “

Example
create a Button, a native Windows button will show
  up if the application is running under windows, a
  native Mac OS button will show up if the application
  is running under Mac OS, a native Linux button will
  show up if the application is running under Linux,
  and so on.
 GUI components are drawn very quickly. This is
  knows as "native performance“
 In AWT, native code, written in a language like C or
  C++

   GUI components look natural for the users of each
    operating systems. This is knows as "native look
    and feel“

   AWT only include components that exist in ALL
    supported operating systems(least common
    denominator) so the problem came from here
SWING
o   Part of the Java standard API
o   It includes classes like JButton, JTextFiled, JMenu,
    and JTree
   Advantage
       It still relies on AWT classes for event handling
        but for rendering components it relies on the
        Java2D API to draw components from scratch

       Does not suffer from the "least common
        denominator“ because it have Swing classes
        defining how to draw Swing controls from scratch

       "platform independence“
   "Pluggable look and feel" that allows controls to
        appear with a different look and feel if desired
       Swing components follow the Model-View-
        Controller (MVC) paradigm, and thus can
        provide a much more flexible UI.
   Disadvantage

       Rendering Swing components is slower than
        rendering AWT components because they are
        drawn from scratch
       Large memory
       When a change happen to the operating system
        so it doesn’t update automatically
SWT
             (STANDARD WIDGET TOOLKIT)
   It is NOT part of the Java standard API
   Advantage
       SWT tries to combine the best of AWT and
        Swing
       There is a native component written for each
        operating system called Java Native interface
       Use less memory
       Rich set of widgets which used to make good
        looking
       Run faster
       When a change happen to the operating system
        so it update automatically
   Disadvantage
    • Also you have to build separate installers for
      every operating systems which you are to
      support.
    • Native look and Feel support
SUMMARY


   There is a big debate between Java developers
    about whether Swing or SWT is better

   So it up to you to choose the most appropriate GUI
    library (SWT or Swing ) to your application
REFERENCE :
 http://www.developer.com/java/other/article.php/217
  9061/Swing-and-SWT-A-Tale-of-Two-Java-GUI-
  Libraries.htm
 http://forum.codecall.net/lounge/37501-swt-vs-
  swing-debate.html
 http://www.ahmadsoft.org/articles/swingswt/swings
  wt.html
 http://www.javalobby.org/java/forums/t63186.html

 http://www.youtube.com/watch?v=1ND16H-ew_4
Thank you 

Más contenido relacionado

La actualidad más candente

Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
Aman Jain
 

La actualidad más candente (20)

Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Google App Engine ppt
Google App Engine  pptGoogle App Engine  ppt
Google App Engine ppt
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
CIS110 Computer Programming Design Chapter (7)
CIS110 Computer Programming Design Chapter  (7)CIS110 Computer Programming Design Chapter  (7)
CIS110 Computer Programming Design Chapter (7)
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Ch 5- Achieving Qualities
Ch 5- Achieving QualitiesCh 5- Achieving Qualities
Ch 5- Achieving Qualities
 
Computer graphics ppt
Computer graphics pptComputer graphics ppt
Computer graphics ppt
 
Internet of Things (IoT) - Introduction ppt
Internet of Things (IoT) - Introduction ppt Internet of Things (IoT) - Introduction ppt
Internet of Things (IoT) - Introduction ppt
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Multiprocessor Architecture (Advanced computer architecture)
Multiprocessor Architecture  (Advanced computer architecture)Multiprocessor Architecture  (Advanced computer architecture)
Multiprocessor Architecture (Advanced computer architecture)
 
MeeGo Mobile OS
MeeGo Mobile OSMeeGo Mobile OS
MeeGo Mobile OS
 
Le pattern adaptateur
Le pattern adaptateurLe pattern adaptateur
Le pattern adaptateur
 
Introduction to Parallel Computing
Introduction to Parallel ComputingIntroduction to Parallel Computing
Introduction to Parallel Computing
 
Intro to GraphQL for Database Developers
Intro to GraphQL for Database DevelopersIntro to GraphQL for Database Developers
Intro to GraphQL for Database Developers
 
Virtual machines and their architecture
Virtual machines and their architectureVirtual machines and their architecture
Virtual machines and their architecture
 
Architecture Description Languages
Architecture Description LanguagesArchitecture Description Languages
Architecture Description Languages
 
IoT architecture
IoT architectureIoT architecture
IoT architecture
 

Similar a Swt vs swing

1. introduction to swing
1. introduction to swing1. introduction to swing
1. introduction to swing
Tuan Ngo
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
backdoor
 
Introduction To The Eclipse Platform
Introduction To The Eclipse PlatformIntroduction To The Eclipse Platform
Introduction To The Eclipse Platform
ciukes
 
JAVA GUI
JAVA GUIJAVA GUI
JAVA GUI
IIITA
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
Viên Mai
 
Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)
WE-IT TUTORIALS
 

Similar a Swt vs swing (20)

GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.ppt
 
Report swings
Report swingsReport swings
Report swings
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
Swing components
Swing components Swing components
Swing components
 
1. introduction to swing
1. introduction to swing1. introduction to swing
1. introduction to swing
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
 
Introduction To The Eclipse Platform
Introduction To The Eclipse PlatformIntroduction To The Eclipse Platform
Introduction To The Eclipse Platform
 
Swing !!! y shikhar!!
Swing !!! y shikhar!!Swing !!! y shikhar!!
Swing !!! y shikhar!!
 
Departmental store management sytem
Departmental store management sytemDepartmental store management sytem
Departmental store management sytem
 
Advanced swing
Advanced swingAdvanced swing
Advanced swing
 
Eclipse vs Netbean vs Railo
Eclipse vs Netbean vs RailoEclipse vs Netbean vs Railo
Eclipse vs Netbean vs Railo
 
JAVA Programming : Topic JAVA Programming Swing
JAVA Programming : Topic JAVA Programming SwingJAVA Programming : Topic JAVA Programming Swing
JAVA Programming : Topic JAVA Programming Swing
 
Advanced java lab swing mvc awt
Advanced java lab swing mvc awtAdvanced java lab swing mvc awt
Advanced java lab swing mvc awt
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
JAVA GUI
JAVA GUIJAVA GUI
JAVA GUI
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FX
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
 
Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)
 
Java server face tutorial
Java server face tutorialJava server face tutorial
Java server face tutorial
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

Swt vs swing

  • 1. SWING & SWT A Tale of Two Java GUI Libraries
  • 2. AWT (ABSTRACT WINDOW TOOLKIT)  Oldest toolkit , part of java standard API  It includes classes like Button, TextField, and Menu  It also provides the necessary event handling mechanism  AWT controls may behave differently under different operating systems For example, it might be possible to right-click on a button under operating system A showing a context menu, but impossible to do so under operating system B
  • 3. It relies on the native GUI elements of each operating systems so known as“Platform dependent “ Example create a Button, a native Windows button will show up if the application is running under windows, a native Mac OS button will show up if the application is running under Mac OS, a native Linux button will show up if the application is running under Linux, and so on.
  • 4.
  • 5.  GUI components are drawn very quickly. This is knows as "native performance“  In AWT, native code, written in a language like C or C++  GUI components look natural for the users of each operating systems. This is knows as "native look and feel“  AWT only include components that exist in ALL supported operating systems(least common denominator) so the problem came from here
  • 6. SWING o Part of the Java standard API o It includes classes like JButton, JTextFiled, JMenu, and JTree  Advantage  It still relies on AWT classes for event handling but for rendering components it relies on the Java2D API to draw components from scratch  Does not suffer from the "least common denominator“ because it have Swing classes defining how to draw Swing controls from scratch  "platform independence“
  • 7. "Pluggable look and feel" that allows controls to appear with a different look and feel if desired  Swing components follow the Model-View- Controller (MVC) paradigm, and thus can provide a much more flexible UI.  Disadvantage  Rendering Swing components is slower than rendering AWT components because they are drawn from scratch  Large memory  When a change happen to the operating system so it doesn’t update automatically
  • 8. SWT (STANDARD WIDGET TOOLKIT)  It is NOT part of the Java standard API  Advantage  SWT tries to combine the best of AWT and Swing  There is a native component written for each operating system called Java Native interface  Use less memory  Rich set of widgets which used to make good looking  Run faster  When a change happen to the operating system so it update automatically
  • 9. Disadvantage • Also you have to build separate installers for every operating systems which you are to support. • Native look and Feel support
  • 10. SUMMARY  There is a big debate between Java developers about whether Swing or SWT is better  So it up to you to choose the most appropriate GUI library (SWT or Swing ) to your application
  • 11. REFERENCE :  http://www.developer.com/java/other/article.php/217 9061/Swing-and-SWT-A-Tale-of-Two-Java-GUI- Libraries.htm  http://forum.codecall.net/lounge/37501-swt-vs- swing-debate.html  http://www.ahmadsoft.org/articles/swingswt/swings wt.html  http://www.javalobby.org/java/forums/t63186.html  http://www.youtube.com/watch?v=1ND16H-ew_4