Swing JOptionPane and JGoodies bug
Posted by andy in : Software on April 8, 2004. There are no responses »We had a weird problem today and thought other people may appreciate the fix.
We have a swing application deployed using Jave Web Start. A java swing JOptionPage was rendered without any GUI components – just a small grey square.
It only failed on Java Web Start and not when we ran the code from the developer machines.
Even more baffling, was that it ran on some machines via Java Web Start and not others…
So we fired up the Web Start console to see what was happening and it worked – the act of running the console changed the behaviour of the app!
Lots of scratching of heads…
The problem was that on some environments, Swing could not find the JGoodies look and feel for the JOptionPane. The fix is to force the UIManager to load the JGoodies class loader:
1 | UIManager.put("ClassLoader", LookUtils.class.getClassLoader()); |

