开发者

How to retain Windows-like appearance of Java GUI in Fedora

开发者 https://www.devze.com 2022-12-22 05:55 出处:网络
I\'m using Netbeans 6.7.1 on Windows. I created a Java application using Swing. Wh开发者_Go百科en I run the same application in my Fedora Core OS, the appearance becomes dull, the fonts and the spacin

I'm using Netbeans 6.7.1 on Windows. I created a Java application using Swing. Wh开发者_Go百科en I run the same application in my Fedora Core OS, the appearance becomes dull, the fonts and the spacing change. How do I avoid this - as the GUI is of prime importance to my application.

Please help..


Unfortunately, the various native themes are only guaranteed to be packaged with the JVMs they're shipped with.

If you really want your gui to look the same across OSes, you really have 3 options:

  1. Use the cross-platform look and feel.
  2. If your clients all use Java 6u10 or newer, use the Nimbus look and feel.
  3. Use a third party look and feel, preferably one that extends the Synth look and feel like Nimbus does.


You have to set the program's look and feel under Project Properties > Application > Desktop App. The default look and feel for the project is to use the OS default look and feel. You might also need to check that the java install on fedora has that look and feel included.

If you want to use Netbeans' gui builder to design a layout in a look and feel that isn't you development machine's default look and feel, you need to use the --laf flag to have Netbeans run with the look and feel you are designing for.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号