Ubuntu – How to get a java apps to use the GTK+ theme

application-developmentgtkjavathemes

Is there a way to get java apps to use my gtk theme?

Best Answer

You can try to set Java's default look and feel to GTK:

Open a terminal ( Ctrl + Alt + T ) and paste the upper one for openjdk and the lower one for sun java .

gksu gedit /usr/lib/jvm/java-6-openjdk/jre/lib/swing.properties

gksu gedit /usr/lib/jvm/java-6-sun/jre/lib/swing.properties

  • Follow the comment in that file and remove the hash sign, so it looks like:

    # uncomment to set the default look and feel to GTK
    swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
    
  • Save and restart the java app.

Before and after:

Related Question