Difference between revisions of "Set all Java apps to use GTK+ font & theme settings"
From Manjaro
Views
Actions
Namespaces
Variants
Tools
(removed dead link) |
m (add }}) |
||
Line 34: | Line 34: | ||
}} | }} | ||
{{SectionTemplate|<translate | {{SectionTemplate| | ||
[[File:Chmsee-icon.png|left|36px]] | |||
<translate>See Also</translate>| | |||
<translate> | <translate> | ||
<!--T:9--> | <!--T:9--> | ||
* [http://askubuntu.com/questions/21886/how-can-i-get-a-java-apps-to-use-the-gtk-theme How can I get a java apps to use the GTK+ theme?(askubuntu)] | * [http://askubuntu.com/questions/21886/how-can-i-get-a-java-apps-to-use-the-gtk-theme How can I get a java apps to use the GTK+ theme?(askubuntu)]}} | ||
</translate> | </translate> | ||
[[Category:Contents Page{{#translation:}}]] | [[Category:Contents Page{{#translation:}}]] |
Revision as of 06:58, 24 January 2023
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.