views:

70

answers:

1

Why running application with SUDO changes GUI appearance?

I.e.Button background, Button size, JTree appearance are behaving differently depending on how the GUI was started with SUDO or not.

Will appreciate your suggestions. Thank you

A: 

You don't give much in the way of detail. Presumably root has paths and/or environment variables set up differently. I would guess that java -fullversion and sudo java -fullversion will give different results.

Tom Hawtin - tackline
owner@ubuntu:~$ java -fullversionjava full version "1.6.0_0-b16"owner@ubuntu:~$ sudo java -fullversion[sudo] password for owner: java full version "1.6.0_0-b16"owner@ubuntu:~$
My guess, root has access to different (additional) font files that the 'owner' user doesn't.
Redbeard
@Redbeard So `public class ListFonts { public static void main(String[] args) { System.out.println(java.util.Arrays.asList(java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts())); }}`
Tom Hawtin - tackline
@user219051 Note that the original version of Java SE 6 has known security vulnerabilities. It is probably a good idea to upgrade to 6u20 or 6u21 (at the time of writing).
Tom Hawtin - tackline