• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between AWT and Swing?

 
me sesil
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i want to know about the difference between awt and swing?please explain me briefly.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're both windowing toolkits. AWT is older, and the newer Swing is built on (parts of) the AWT.
Basically, the difference is this: when the AWT wants to draw a button, it asks the native windowing system to do it -- i.e., it creates a Windows button control, or a Motif button widget. This AWT applications look like the native platform. There is only a very small choice of components, however.
When Swing wants to make a button, it draws it using the methods of the Graphics2D class. Therefore, Swing buttons don't have to look like the native platform's buttons. There are a much wider range of Swing components than AWT components.
 
me sesil
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill thanks
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum, where folks are most familiar with these topics...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic