You are not logged in.
I stumbled across this article last night about making your Swing-based applications theme themselves according to your current GTK 2.0 Look and Feel (laf). Essentially, all you need to do is create a file in your `$JAVA_HOME/jre/lib/' directory called "swing.properties" (for me, this was `/usr/lib/jvm/java-1.6.0-openjdk/jre/lib/swing.properties'), and put this inside:
swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
... then, whenever you run a Swing application with `java ApplicationName', it will use your current GTK 2.0 theme to draw its widgets -- pretty nifty! However, for me, it's not perfect as the font size is a little too large, but it's still a HUGE improvement over the old metal theme (or whatever it is Swing uses by default). You can alternately launch Swing applications with your GTK theme manually with `java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel ApplicationName'.
To configure Netbeans to use your theme, append this to the end of the `netbeans_default_options' variable in your "netbeans.conf" file (/usr/share/netbeans/etc/netbeans.conf):
--laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
... so it looks something like this:
netbeans_default_options="-J-client -J-Xverify:none -J-Xss2m ... --laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
... but be warned, this made Netbeans horribly ugly on my end. I use Kate and/or Vim for most of my Java programming anyway
If anybody's willing to check it out, let me know your experience; I'll play around and see if I can get the font size issue resolved and post my results later.
Note: This will work with the gtk-qt-theme-engine on KDE, as that's what I'm using now.
Dylon
Offline
Thanks for giving the heads up on this.
Instead of swing.properties, I add the following to my .bashrc:
export _JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Offline
Thanks for giving the heads up on this.
Instead of swing.properties, I add the following to my .bashrc:
export _JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Worked perfectly , thanks
Offline
None of these tips helped. Any clue why? Is there any package needed for that?
Offline
Sorry for resurrecting an old thread, but I'd just like to say that Netbeans can be configures way further than just simple changes in swing. You can for example use Nimbus, and get a result like this. You simply add what is said in that page to your /usr/share/netbeans/etc/netbeans.conf, but remember to use full path (pref. absolute I guess) for both files. Both files are also easily changeable. The .jar-file can be changed by running it with java -jar nimrodlf.jar.
This is my setup with Netbeans, and it's the default DarkGrey-theme.
Offline
None of these tips helped. Any clue why? Is there any package needed for that?
Are you running Oracle JDK 6 or OpenJDK 7? If you're on 7, there's a different package name for the Nimbus LAF (javax.swing.plaf.nimbus.NimbusLookAndFeel) and likely as well for the GTK LAF. Try javax.swing.plaf.gtk.GTKLookAndFeel (not tested this myself).
Offline
I'm pretty sure I was running 6 a year ago. xD Anyway I've stopped strugling to change L&F.
Offline
Oh jeez - I never realized that was a post from 2011. I hate these thread resurrections.
Offline
The export trick works for me, you forgot to put the value in ''.
Posted by Phitherek_
Offline