Difference between revisions of "Set all Java apps to use GTK+ font & theme settings"
From Manjaro
Views
Actions
Namespaces
Variants
Tools
K2latmanesh (talk | contribs) (Marked this version for translation) |
K2latmanesh (talk | contribs) m (Adding translation tags.) |
||
Line 3: | Line 3: | ||
{{SectionTemplate|<translate><!--T:1--> Introduction</translate>|2= | {{SectionTemplate|<translate><!--T:1--> Introduction</translate>|2= | ||
<translate> | |||
This fix makes your Java apps use your GTK+ theme (colours & such) & your chosen font settings. Here is how it looks like: | This fix makes your Java apps use your GTK+ theme (colours & such) & your chosen font settings. Here is how it looks like: | ||
Line 9: | Line 10: | ||
| | | | ||
[[File:Java_GTK_look.png|thumb|none|400px|After the fix]] | [[File:Java_GTK_look.png|thumb|none|400px|After the fix]] | ||
|1|1}}}} | |1|1}} | ||
</translate>}} | |||
{{SectionTemplate|<translate><!--T:2--> How do you do it?</translate>|2= | {{SectionTemplate|<translate><!--T:2--> How do you do it?</translate>|2= |
Revision as of 07:06, 13 February 2022
This fix makes your Java apps use your GTK+ theme (colours & such) & your chosen font settings. Here is how it looks like:
Set the variable _JAVA_OPTIONS by running this command in a terminal:
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 ${_JAVA_OPTIONS}"
First test to see if the outcome is what you expect by running your Java app from the same terminal window.
If the result looks good to you, let us make the changes permanent:
Append the above definition of the _JAVA_OPTIONS variable to ~/.profile (for your user only) or /etc/profile.d/90-java_ops.sh (system-wide). In both cases, if the file does not exist, create it.