A strange error...

When I tried to run my program the last time this error came up and my Frame went invisible, well not really but what's in the Frame.

If you need I'll show you some code.

This is the error:

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

null

at sun.java2d.SunGraphics2D.drawString(Unknown Source)

at List.paint(List.java:28)

at RectPanel.paintComponent(RectPanel.java:65)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JLayeredPane.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paintToOffscreen(Unknown Source)

at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)

at javax.swing.RepaintManager.paint(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)

at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)

at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)

at java.awt.Container.paint(Unknown Source)

at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)

at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)

at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)

at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknow

n Source)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

[2269 byte] By [Consideratea] at [2007-11-26 19:33:19]
# 1

> at sun.java2d.SunGraphics2D.drawString(Unknown Source)

> at List.paint(List.java:28)

That List class is yours, right? And you're calling drawString and the result is a NullPointerException. So the most likely thing causing that message is that you called drawString(null). Check that out. Not strange at all.

DrClapa at 2007-7-9 22:05:35 > top of Java-index,Java Essentials,Java Programming...