0

we are using PlasticLookAndFeel from JGoodies in the Version jGoodies-looks 2.2.2. I know this Version is not new, but we also tried it with the current Version of JGoodies, which didn´t help.

Since updating to Java 1.6.0_25 or 1.7.0_25 we have several problems, we cannot solve.

Some sample Effects are:

Stack Trace:
null
javax.swing.JFileChooser.isTraversable(Unknown Source)
javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
javax.swing.JFileChooser.<init>(Unknown Source)

or: small-JDialogs with no visible and non resizable content

We have also tried to centralize our calls to UIManager.setLookAndFeel(xx) and put it in the EDT-Thread, but that didn´t solve the problem. (How does Java for OS X 2013-004 affect (break) Swing applications?) If we delete these calls, everything works fine with MetalLookAndFeel.

The problem only comes with:

  • Java 1.6.0 Update 51 or Java 1.7.0 Update 25
  • Java Webstart
  • Non-standard look and feels

We would be very happy if someone knows a solution or can help us with some tipps.

Thanks.

Community
  • 1
  • 1
Bernhard Kern
  • 208
  • 2
  • 10
  • 2
    not knowing mac, but the one important thingy that changed since u25 are the considerably tightened security restrictions. Maybe goodies tries to access something that isn't allowed in the sandbox any longer. – kleopatra Sep 10 '13 at 14:53

1 Answers1

0

we solved the problem. It was a ClassLoading-Problem that only occurs with Webstart.

An easy Workaround is:

  • Start Application with Webstart-Console (Java -> Extended -> Java Console).

A solution is:

  • Add a different ClassLoader to UIDefaults in your LookAndFeel-Method initComponentDefaults().

You can do it like this:

protected void initComponentDefaults(final UIDefaults table) {
    table.put("ClassLoader", LookUtils.class.getClassLoader());
{

or

protected void initComponentDefaults(final UIDefaults table) {
    final Object[] lookAndFeelDefaults = {"ClassLoader", LookUtils.class.getClassLoader()}
    table.putDefaults(lookAndFeelDefaults);

{

It is also recommended that you set your look and feel in AWT-Event-Dispatcher-Thread.

javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
    @Override
    public void run() {
  try {
           javax.swing.UIManager.setLookAndFeel(applicationLookAndFeel);
  } catch (Exception e) {
     e.printStackTrace();
  }
    }
});

The NullPointer in the original post was caused by a missing Icon which could not be loaded with the standard classloader.

Bernhard Kern
  • 208
  • 2
  • 10
  • One more thing to say: This was not a mac problem. There is a new Version of JDK 1.7 Update 40, perhaps the problem would not be there anymore. If sb knows more, please update here. I have found sth in release notes which caused Problems on macs, it was also an "Icon-problem" ;), perhaps similar to this one. – Bernhard Kern Sep 11 '13 at 07:58
  • Hi again, I think this is a Java/Java-User problem and not of JGoodies. We had similar Problems with JXTable in the newer Java-Versions which uses an own look and feel. Demos of jGoodies are working well with newer Java Versions, since they are using there ClassLoader in LaF – Bernhard Kern Sep 17 '13 at 11:06