harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tharindu Mathew" <mcclou...@gmail.com>
Subject JRootPane NPE
Date Fri, 04 Apr 2008 06:12:52 GMT
ERROR: UIDefaults.getUI() failed: java.lang.NullPointerException
    at javax.swing.UIDefaults.getUI(UIDefaults.java:339)
    at javax.swing.UIManager.getUI(UIManager.java:222)
    at javax.swing.JPanel.updateUI(JPanel.java:141)
    at javax.swing.JPanel.<init>(JPanel.java:56)
    at javax.swing.JPanel.<init>(JPanel.java:76)
    at javax.swing.JRootPane.createGlassPane(JRootPane.java:278)
    at javax.swing.JRootPane.<init>(JRootPane.java:78)
    at javax.swing.JFrame.createRootPane(JFrame.java:175)
    at javax.swing.JFrame.frameInit(JFrame.java:393)
    at javax.swing.JFrame.<init>(JFrame.java:123)
    at
net.sf.freecol.client.gui.FullScreenFrame.<init>(FullScreenFrame.java:34)
    at net.sf.freecol.client.FreeColClient.startGUI(FreeColClient.java:218)
    at net.sf.freecol.client.FreeColClient.access$000(FreeColClient.java:31)
    at net.sf.freecol.client.FreeColClient$1.run(FreeColClient.java:142)
    at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:98)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:78)
    at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:138)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
    at
java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)


In the UI defaults class:

 Method method = null;
            if (uiClass == null) {
                uiClass = getUIClass(classID,
comp.getClass().getClassLoader());
                method = getCreateUIMethodPriveledged(uiClass);

                put(fullClassName, uiClass);
                put(uiClass, method);
            } else {
                method = (Method)get(uiClass); *<--- method is null, because
no value exists for the uiClass key*
            }
            return (ComponentUI)method.invoke(null, new Object[] { comp });
*<--- causes NPE when tryin to invoke*

What is supposed to return to the method variable? Does this return null
because the setUI() method is not called from within JRootPane?

-- 
Regards,

Tharindu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message