Slyh: panel.getGraphics liefert null?

Beitrag lesen

Hallo,

Graphics g = Panel.getGraphics();

die Graphics-Instanz. Jedefalls dachte ich, dass es so funktioniert. Leider ist der Rückgabewert NULL. Woran kann das liegen?

http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Component.html#getGraphics()

"Creates a graphics context for this component. This method will return  null if this component is currently not displayable."

Liegt's daran?

Gruß
Slyh