views:

178

answers:

2

Hi all,

I'm using Netbeans 6.7.1 on Windows. I created a Java application using Swing. When 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..

A: 

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.

unholysampler
Under application , in the project properties window , only the following fields are available to be set : title ,vendor , description , homepage , splash-screen..
trinity
The Application category has a sub-tree of Desktop App and Web Start. As Powerlord said, you might not be able to get the Windows look and feel on Linux. I ran into the same issue and switched to Metal look and feel.
unholysampler
oh , okay ! thanks .
trinity
+3  A: 

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.
R. Bemrose
+1 for suggesting Nimbus, It can give a somewhat uniform appearance.
Amit