wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Swing Renders Native Controls? (getSystemLookAndFeelClassName) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing Renders Native Controls? (getSystemLookAndFeelClassName)" Watch "Swing Renders Native Controls? (getSystemLookAndFeelClassName)" New topic
Author

Swing Renders Native Controls? (getSystemLookAndFeelClassName)

Bryan Cairns
Greenhorn

Joined: Oct 27, 2007
Posts: 10
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?

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2095
    
    7
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

Joined: Oct 27, 2007
Posts: 10
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing Renders Native Controls? (getSystemLookAndFeelClassName)
 
Similar Threads
Swing on the browser
Architecting Swing apps - best practices?
JavaFX / Swing/ JSF
Character by Character input
swing