You are not logged in.
In java:
UIManager.getSystemLookAndFeelClassName()
returns javax.swing.plaf.metal.MetalLookAndFeel instead of com.sun.java.swing.plaf.gtk.GTKLookAndFeel as it should do on Linux. I've changed swing.properties in my java-8-openjdk folder to
swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
so it defaults to GTK laf regardless, but it's still rather annoying that
UIManager.getSystemLookAndFeelClassName()
still doesn't return the GTK laf, because I use
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
so my program will work on other computers, but of course for me, that returns the Metal laf, which then overrides the Default laf, which I have set to GTK.
So, in short, is there a setting somewhere where I can change what the System look and feel (as in the string which returns when I call the above method) to com.sun.java.swing.plaf.gtk.GTKLookAndFeel
I hope I've been clear, any help would be much appreciated.
Davy
Last edited by Davy (2017-10-08 21:48:45)
Offline
is there a setting somewhere where I can change what the System look and feel (as in the string which returns when I call the above method) to com.sun.java.swing.plaf.gtk.GTKLookAndFeel
I'm not really familiar with Java but this Stack Exchange thread says that you can export the values to the global environment.
To do this in a stock BunsenLabs desktop then add the export line(s) to the file at ~/.xsessionrc
If the display manager (graphical login screen) is dropped then ~/.profile should be used instead, that file is also parsed for TTY (console) logins.
Offline
archwiki also has good info on java (also note the 2 more articles on the right-hand side).
Offline
Marvellous! I've now added
export _JAVA_OPTIONS='-Dswing.systemlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
to my .xsessionrc file. It's exactly what I needed. UIManager.getSystemLookAndFeelClassName() now no longer returns javax.swing.plaf.metal.MetalLookAndFeel. Instead it now returns com.sun.java.swing.plaf.gtk.GTKLookAndFeel like it should for Linux. Thank you very much!
Edit: reading further on that Archwiki page I found a fix for a very specific bug I had encountered in the past few days. A very happy coincidence.
Last edited by Davy (2017-10-08 22:11:13)
Offline
Great news, thanks for reporting back
Offline