• 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 Renders Native Controls? (getSystemLookAndFeelClassName)

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a read several books on java and studying for the SCJP exam.

Everything I have read says that Java draws the controls (for example a button). Where other languages / frameworks like .Net, QT framework, SWT, and wxWidgets create instances of the native controls from the OS.

That swing will create instances of native controls rather then draw them when you use:
UIManager.getSystemLookAndFeelClassName()

Can anyone shed some light on this?

 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default Look and Feel (LAF) for Swing is the Metal LAF.

When you use: UIManager.getSystemLookAndFeelClassName() it doesn't not mean that native controls will be used. It means that Swing will use the default LAF for the platform the application is running on. The controls will be painted by Swing to look like the controls for that platform.
 
Bryan Cairns
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing I found on google:

http://forum.kde.org/viewtopic.php?f=15&t=37490


Both WindowsLookAndFeel and GTKLookAndFeel are using native invocations to paint themselves. That's why they are using much more memory than "pure java" LookAndFeels, because abstraction level is doubled

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic