Reputation: 775
I downloaded 4 LookAndFeel(LAF) libraries and one of them is SeaGlass LAF for java GUI, so far I managed to use them by writing this line:
UIManager.setLookAndFeel(new SeaGlassLookAndFeel());
but while I'm desinging I have to see what I'm building in the default Metal LAF in Netbeans, so the only way for me to see the real result is by running the application. I know there's a way to change JFrame Preview design, and I know how to do it, but I don't know how can I add my LAF libraries to this list Netbeans provides. So I will really appreciate an answer.. I've looked everywhere, I know there's another guy who talks about something like this in another post but I couldn't found the answer there.
Upvotes: 0
Views: 270
Reputation: 1892
In NetBeans IDE installation directory
under Ubuntu it’s /home/libor/dev/netbeans/
under Windows it’s C:\Program Files\NetBeans\
Find etc directory and netbeans.conf file
Add to the end of line beginning with netbeans_default_options parameter
—laf path.to.your.laf
e.g. --laf javax.swing.plaf.nimbus.NimbusLookAndFeel
On my Ubuntu 11.10 and Oracle JDK 7 I have available:
javax.swing.plaf.metal.MetalLookAndFeel
javax.swing.plaf.nimbus.NimbusLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Please note that GTKLookAndFeel is not available in Windows.
--laf Nimbus for Nimbus L&F
--laf javax.swing.plaf.metal.MetalLookAndFeel for Metal L&F
--laf Gtk for Metal L&F
--laf path.to.your.laf for any other L&F
Notice that I am using fully qualified class with package name or just class. If class is available to NetBeans launcher script (JDK standard LAFs), you can abbreviate to class name.
So complete line can looks like this (text wrapped for better legibility):
netbeans_default_options=”-J-client -J-Xss2m -J-Xms32m
-J-XX:PermSize=32m -J-XX:MaxPermSize=384m
-J-Dapple.laf.useScreenMenuBar=true
-J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true
-J-DuseSystemAAFontSettings=lcd -J-Dswing.aatext=true —laf Gtk”
If you want the same for your NetBeans Platform application add to project (suite) project.properties file this line:
run.args.extra=—laf Nimbus
Upvotes: 2