tags:

views:

81

answers:

1

Hi.

I have a Swing GUI that I developed Netbeans Matisse in Linux. For some odd reason, the look and feel of the application looks different when it's run by root (it looks better, actually).

Is there a reasoning for this? Thanks

+3  A: 

Swing is a cross platform GUI. It renders itself by default with a look and feel which most closely resembles the platform it is running on. There are look and feels for GTK, Motif and Windows as well as cross platform themes like Metal & Nimbus.

In Linux it will default to use the GTK theme if you have gtk 2.2 installed. It may be on your system that the GTK theme is different for root than it is for a regular user and your Swing app is reflecting that. Or it may be that it can't detect GTK correctly in root and is defaulting to Motif.

Try logging in as root and see if the desktop theme is the same or different. Try running the app and see if it reflects the desktop theme or is something else entirely.

locka