Car*_*ndo 1 java user-interface swing
我有一个Swing GUI,我在Linux中开发了Netbeans Matisse.由于一些奇怪的原因,当它由root运行时,应用程序的外观和外观看起来不同(实际上看起来更好).
有没有理由呢?谢谢
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.
在Linux中,如果安装了gtk 2.2,它将默认使用GTK主题.可能在您的系统上,GTK主题与root用户的不同,而不是普通用户,而您的Swing应用程序正在反映这一点.或者它可能无法在root中正确检测GTK并且默认为Motif.
尝试以root身份登录,看看桌面主题是相同还是不同.尝试运行该应用程序,看看它是否反映了桌面主题或完全是其他内容.