Manjaro Difference between revisions of "Set all Java apps to use GTK+ font & theme settings"

Difference between revisions of "Set all Java apps to use GTK+ font & theme settings"

From Manjaro
imported>Photon
(Created page)
(No difference)

Revision as of 10:03, 11 March 2017

Introduction

This fix makes your Java apps use your GTK+ theme (colours & such) & your chosen font settings.


How do you do it?

First try if the outcome is what you expect:

1) Set the variable _JAVA_OPTIONS accordingly:

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'

2) Run your Java app from the same terminal window.

If the result looks good to you, let us make the changes permanent:

1) Append the above definition of the _JAVA_OPTIONS variable to ~/.profile (for your user only) or /etc/profile (system-wide). If the file does not exist, create it.

2) Restart the system

3) Start your Java app to check the result.

4) If, for some reason, the entry in ~/.profile or /etc/profile had no effect, you can put the following line into /etc/environment:

_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"


Links

The source is this question at askubuntu.com:

How can I get a java apps to use the GTK+ theme? [1]


Support

Following is a link to this page's forum counterpart where you can post any related feedback: [2]



Cookies help us deliver our services. By using our services, you agree to our use of cookies.