MetalLookAndFeel

Hi all,

I'm quite new with GUI development and I would ask to you a question about look and feel.

I know that the default look and feel for a java application using swing is javax.swing.plaf.metal.MetalLookAndFeel, ok.

I'm creating a very simple application and each time I add a component, I try to execute this simple gui to see if all went ok.

I don't know why, but now the lookandfeel Metal has disappeared, how is it possible?

I tried also to create a new java project, creating only a frame with a menubar, and it has the metal lookandfeel, insted in my simple applciation that lookandfeel has disappeared!

But I'm sure that in the beginning there was that metal lookandfeel, have you some ideas?

Thank you very much for the answers!

Bye

Raffaele

[817 byte] By [Gamby1980a] at [2007-10-3 1:44:05]
# 1
> have you some ideas?The LAF doens't just change randomly unless you execute some code to change the LAF.
camickra at 2007-7-14 18:42:14 > top of Java-index,Desktop,Core GUI APIs...
# 2

Sorry but I'm not so beginner to change the LAF without understanding what I'm doing....

I also tried to force the LAF to metal but nothing has happened:

try {

UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

} catch (InstantiationException e) {

e.printStackTrace();

} catch (ClassNotFoundException e) {

e.printStackTrace();

} catch (UnsupportedLookAndFeelException e) {

e.printStackTrace();

} catch (IllegalAccessException e) {

e.printStackTrace();

}

In your opinion why that code should not install that LAF that I correctly specified?

And why instead the com.sun.java.swing.plaf.windows.WindowsLookAndFeel runs correctly?

Thank you

Gamby1980a at 2007-7-14 18:42:14 > top of Java-index,Desktop,Core GUI APIs...
# 3
You must set the look'n'feel before you display the first window. My guess is that you've changed your app so that now you're popping up a window (splash screen?) before you call setLookAndFeel()
TimRyanNZa at 2007-7-14 18:42:14 > top of Java-index,Desktop,Core GUI APIs...
# 4

I'm calling setLookAndFell() in the Main method, and then I call Gui myGui = new GUI(); where the windows is initialized and set to visible true.

However, the metal look and feel has disappeared before that I have inserted in the code the call to setLookAndFeel() method, this is the strange thing....

That is, I was writing the code, component after component I tried to executing the app, but, from a certain point the LAF disappeared.

Now I'm trying to rewriting the app following the same steps, till now it seems going ok, that is, the metal LAF (which is the default LAF) is correctly set.

Thank you.

Gamby1980a at 2007-7-14 18:42:14 > top of Java-index,Desktop,Core GUI APIs...