9

From what I've found out, the Nimbus Look and Feel was introduced in Java 6 Update 10.

I have project where I use that Look and Feel.

Is there any situation where, the user has a Java VM newer than 6 update 10 (for example 6 update 26) and the Nimbus Look and Feel is not available ? This situation might occur if for example, Look and Feels can be manually/explicitly removed, but I've not been able to find out if this can be done.

So basically, is there a 100 % guarantee that, if the user has the proper Java VM version, the Nimbus Look and Feel will be available 100 % of the time ?

Thank you in advance.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Radu Murzea
  • 10,724
  • 10
  • 47
  • 69

2 Answers2

4

There's no clear way for a user to remove a particular Look & Feel from their JVM. Anything is possible, though.

What's wrong with just checking for it in the code?

gmoore
  • 5,506
  • 5
  • 29
  • 36
  • Well, a particular problem is with JTextFields. In Nimbus their height is a lot smaller and, if Nimbus is applied, I must make them bigger. – Radu Murzea Jan 09 '12 at 20:31
  • Are you asking how to detect and react to Nimbus being installed? – gmoore Jan 10 '12 at 15:39
  • No, I know how to do that. I'm asking if I need to. If there is no way a user can remove Look and Feel's from the JVM, then I don't need to. But if he can... – Radu Murzea Jan 11 '12 at 11:34
4

In Java 7 the package path is changed ("sun" removed: com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel): javax.swing.plaf.nimbus.NimbusLookAndFeel, so it depends how you invoke the look and feel. In general this action of oracle might be seen as a positive endorsement of the nimbus look and feel.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
  • 2
    Note that they didn't remove the old name. They retained the class `com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel` as an empty extension of `javax.swing.plaf.nimbus.NimbusLookAndFeel`, so code which uses the Java 6 class name still works fine. – Boann Jul 19 '12 at 13:51