I noticed that Java offers different appearance classes for root and non-root users. I am trying to figure out how to make LAF consistent. Moreover, it is incompatible even with the / root user: it depends on how the / root user is registered:
Sample code (compiled and packaged in laf.jar ):
import javax.swing.UIManager; public class laf { public static void main(java.lang.String[] args) { try { System.out.print(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } } }
Scenario 1 Logging in (as a graphical user interface) as a regular user
Output Example (as user )
[ xxx@yyy Downloads]$ java -classpath laf.jar laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Example output (go to root via su )
[ root@yyy Downloads]
Scenario 2 Logon (in GUI mode) with user rights
Output Example (as root )
[ root@yyy Downloads]
Scenario 3 Logging in via SSH as a regular user (similar to scenario # 1 above, but in this case the same LAF)
Output Example (as user )
[ xxx@yyy Downloads]$ java -classpath laf.jar laf javax.swing.plaf.metal.MetalLookAndFeel
Output Example (Go to Root )
[ root@yyy Downloads]
Software version:
[ root@yyy Downloads]
source share