Switching GTK theme on Java 1.6 (i.e., mustang)  
Author Message
Karl Mueller





PostPosted: 2007-1-14 14:13:00 Top

java-programmer, Switching GTK theme on Java 1.6 (i.e., mustang) I'm at a loss on how to change on-the-fly the theme (i.e., resource) for the
GTK look and feel on Java 1.6 (Mustang). On 1.5 it was a simple matter of
setting a system property (i.e., "swing.gtkthemefile") like this:
System.setProperty ("swing.gtkthemefile", fGTKThemeFile);

But on Mustang it has been completely changed.

It is probably just as easy but I'm missing something?

Thanks.

Karl
email***@***.com


 
Karl Mueller





PostPosted: 2007-1-15 9:34:00 Top

java-programmer >> Switching GTK theme on Java 1.6 (i.e., mustang) Okay, I'm going to go ahead and answer my own question which I have finally
figured out after many hours of trial and error etc. The long and short of
it is that I was using the same code that I had been using under jre 1.5 and
thus I set the following system properties:

System.setProperty ("swing.metacitythemedir", metacityThemeDir);
System.setProperty ("swing.metacitythemename", metacityThemeName);

Setting that property for the metacity theme cause the GTK look and feel to
not pick up the desktop theme from Gnome. I simply commented out the above
code and now the GTK look and feel picks up whatever theme I have set up on
my Linux (i.e., SUSE) desktop. It is pretty cool!

Anyone have any comments/suggestions on having the option to also override
the above behavior with an explicit gtk theme which could be passed to the
GTK look and feel as a file path (i.e., some path to a theme resource file
(i.e., gtkrc))? Again, in jre 1.5 (i.e., Tiger) I had done the following
which does not work under jre 1.6 (i.e., Mustang):
System.setProperty ("swing.gtkthemefile", fGTKThemeFile);

Thanks in advance.

Karl


"Karl Mueller" <email***@***.com> wrote in message
news:45a9c9e0$0$4893$email***@***.com...
> I'm at a loss on how to change on-the-fly the theme (i.e., resource) for
> the GTK look and feel on Java 1.6 (Mustang). On 1.5 it was a simple matter
> of setting a system property (i.e., "swing.gtkthemefile") like this:
> System.setProperty ("swing.gtkthemefile", fGTKThemeFile);
>
> But on Mustang it has been completely changed.
>
> It is probably just as easy but I'm missing something?
>
> Thanks.
>
> Karl
> email***@***.com
>