Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

swings and operating System  RSS feed

 
Harry Singh
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am beginner to swings. so i wanna now why is swing light weight is it because of native peer components. and well java is like platform independent so if the JVm makes native peer components and they depend on operating system then how can we say that it dont depend on operating system... isnt it? correct me if i am wrong..
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harjinder,
Your logic is backwards. AWT is called heavyweight because it relies on the OS to draw and provide functionality to UI items. The OS stuff is considered heavy (think big).
Swing is called LightWeight because it handles all the drawing and functionality and doesn't need the OS for drawing or functionality. Therefore, we can have:
Motif look-and-feel on Windows or Mac, or
Windows look-and-feel on Unix or Mac, or
Mac look-and-feel on Unix and Windows.
Regards,
Manfred.
 
Bill Prentice
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harjinder
Be aware that not all of swing is lightweight, there are still some heavies in there, notably JFrame, JDialog, JWindow and I think JApplet.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!