"AWT-EventQueue-0" java.lang.NullPointerException

Hi,

I'm getting some NullPointerException in my code. I dunno the reason why i'm getting this problem. I cudn't see any problem in my code.

This is the error i'm getting

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

at com.infosys.profiler.installer.main.ProfilerInstaller.moveToPane(ProfilerInstaller.java:117)

at com.infosys.profiler.installer.main.ProfilerInstaller$2.actionPerformed(ProfilerInstaller.java:155)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)

at java.awt.Component.processMouseEvent(Component.java:5488)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)

at java.awt.Component.processEvent(Component.java:5253)

at java.awt.Container.processEvent(Container.java:1966)

at java.awt.Component.dispatchEventImpl(Component.java:3955)

at java.awt.Container.dispatchEventImpl(Container.java:2024)

at java.awt.Component.dispatchEvent(Component.java:3803)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)

at java.awt.Container.dispatchEventImpl(Container.java:2010)

at java.awt.Window.dispatchEventImpl(Window.java:1774)

at java.awt.Component.dispatchEvent(Component.java:3803)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

The following is the piece of code where i'm getting tht null pointer exception

publicvoid moveToPane(BasePane pane){

Dimension size = frame.getContentPane().getSize();//this is the line i'm getting tht exception

System.out.println("Size:"+size.getHeight());

JPanel contents =new JPanel();

contents.setLayout(new BorderLayout());

header = createHeader();

contents.add(header,"North");

body = pane.getPanel();

contents.add(body,"Center");

footer = pane.getButtons();

contents.add(footer,"South");

contents.revalidate();

contents.setSize(size);

frame.setContentPane(contents);

pane.run();

}

[3298 byte] By [eatJavaa] at [2007-10-2 6:20:16]
# 1
> Dimension size = frame.getContentPane().getSize();frame is null, somehow.
hiwaa at 2007-7-16 13:22:12 > top of Java-index,Desktop,Core GUI APIs...