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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.