You are not logged in.

#1 2012-12-11 17:10:13

shadowman21
Member
Registered: 2011-12-26
Posts: 4

I can't get any java applications at all to apply "gtkLookandFeel"

I tried the methods provided in the wiki, attempted using the swing.properties file, even running it with java directly(with the options enabled) and all of them have absolutely no effect whatsoever, I still get the default "metal" theme in all java windows except for eclipse.

Offline

#2 2012-12-11 18:36:36

johni
Member
Registered: 2012-02-03
Posts: 102

Re: I can't get any java applications at all to apply "gtkLookandFeel"

Some java programs set the look and feel themselves, ignoring the properties you may set.   They usually have a setting to change it.

Can you give me a specific example of a program that is not getting the settings, and exactly what you are doing to set it?   A common program I can download and try myself would be most helpful.

Offline

#3 2012-12-11 19:31:02

shadowman21
Member
Registered: 2011-12-26
Posts: 4

Re: I can't get any java applications at all to apply "gtkLookandFeel"

One such application is geograbra

when run from console,  I get this :

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel 

I've attempted to put

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

in the usual places, /etc/profile.d/jre.sh, .bashrc, and as well trying to run

java -jar -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel /usr/share/java/geogebra/geogebra.jar 

to no avail

Offline

#4 2012-12-11 19:48:13

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: I can't get any java applications at all to apply "gtkLookandFeel"

I confirm that following the instructions in the wiki on this subject does not have the expected result. Running the NetX control panel (itweb-settings) from the icedtea-web-java7 package with _JAVA_OPTIONS set as described does enable anti-aliases fonts, but doesn't switch from Metal to GTK. I haven't tested any other Java stack besides jre7-openjdk (and I'm not going to do so, since switching Java installs is disruptive).

Offline

#5 2012-12-11 20:32:19

johni
Member
Registered: 2012-02-03
Posts: 102

Re: I can't get any java applications at all to apply "gtkLookandFeel"

It appears the GeoGebra ignores the default property, and forces the Metal Look and Feel by calling UIManager.getCrossPlatformLookAndFeelClassName() to get the look and feel.  Luckily java lets you set the cross platform look and feel name with a property.

This is a little bit of a hack, but it will force geogebra to use GTK:

java -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -jar /usr/share/java/geogebra/geogebra.jar

Offline

#6 2012-12-11 21:13:44

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: I can't get any java applications at all to apply "gtkLookandFeel"

johni wrote:

It appears the GeoGebra ignores the default property, and forces the Metal Look and Feel by calling UIManager.getCrossPlatformLookAndFeelClassName() to get the look and feel.  Luckily java lets you set the cross platform look and feel name with a property.

This is a little bit of a hack, but it will force geogebra to use GTK:

java -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -jar /usr/share/java/geogebra/geogebra.jar

I confirm that this works with NetX's own components as well. Very nice!

Offline

#7 2012-12-12 02:47:27

shadowman21
Member
Registered: 2011-12-26
Posts: 4

Re: I can't get any java applications at all to apply "gtkLookandFeel"

Thanks! that did the trick

Offline

#8 2012-12-12 16:24:20

johni
Member
Registered: 2012-02-03
Posts: 102

Re: I can't get any java applications at all to apply "gtkLookandFeel"

shadowman21 wrote:

Thanks! that did the trick

I'm glad to hear it worked for you.   You should edit the message subject and add [SOLVED] to the front of it.

I added this trick to the Arch Wiki entry for java:

https://wiki.archlinux.org/index.php/Java

Last edited by johni (2012-12-12 16:38:26)

Offline

Board footer

Powered by FluxBB