• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Swing Components

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How AWT components are differ from swing components?
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you search on "Swing versus AWT"
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Swing/AWT forum.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swing components have their own "look-and-feel," which is derived from Java. They make little use of the underlying OS, which is called "lightweight." Some AWT classes (eg Color) don't have a "look-and-feel" as such, and are therefore not duplicated in Swing. Their inheritance varies, but you will usually find a Swing class has a superclass in AWt somewhere. Those classes in Swing which correspond to AWT classes have the same name with a J prefix.

AWT components are older than the corresponding Swing classes, and they make heavy use of the OS, and are called "heavyweight." They do not have a "look-and-feel" of their own, but "borrow" a "look-and-feel" from the OS.

So: A Swing app using "metal" "look-and-feel" will run on Windows and on a Mac, and ought to look the same.
An AWT app will run on Windows and Mac, but will look different.

CR
reply
    Bookmark Topic Watch Topic
  • New Topic