• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX - UIManager look and feel "scope"?

 
BillLeighton
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I do a UIManager.setLookAndFeel(...) at the start of my application, do I need to check if my LookAndFeel is what I expect in other GUI classes, or can I rest easy that for the life of the app running, the LookAndFeel I initially set will be there?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bill,
I think the question is: what are you setting the look and feel to? If you are setting it to Windows or to Macintosh L&F, then there is no guarantee that your examiner will have such a platform (and those L&Fs cannot be distributed), and so what they see may be totally different to what you planned.
My recommendation would be not to set the look and feel at all. You might want to set it yourself just for testing purposes, but do most of your design work with the default L&F. That way it should look the same on all platforms.
Regards, Andrew
 
BillLeighton
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah.... I was under the impression that it was safest to set the Look and Feel to "Metal" to guarantee it would look and feel the same cross-platform...
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bill,
OK, I understand what you are trying to do now.
To answer your original question - I believe that once you have succesfully set the look and feel, then it should remain in effect for the remainder of your applications life.
Personally I didn't set the look and feel. That way the user could use a different look and feel if they really wanted to, but by default it would be the Java Look and Feel.
Regards, Andrew
 
Jack Conway
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be acceptable to set the look and feel to the classname returned by UIManager.getSystemLookAndFeelClassName() ? That would set to the correct native look and feel (if there is one), and if it fails no harm is done.
(I say this because personally I cannot stand Metal and I think their windows look and feel is pretty accurate)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic