I am creating a Java Stand-ALone application (NOT an Applet) in which
I need to draw Lines, shapes, etc..Graphics primatives, employing class Graphics
methods. I am very familiar with how to do this in Applets. But how is it done with non-Applets:

I have tried constructing a Frame in main(), and then calling its .getGraphics() method to retrieve a Graphics context for that frame w/which to work.
That always fails w/a "NULL Pointer exception". Then, I tried "extend"ing
a MyPanel class derived from class Panel, and overriding its paint() method.
Within the Panel's inherited Component.paint() code block, I make the g.drawLine() and g.drawOval(), calls just as would be done w/an Applet's paint() method.
e.g:
class MyPanel extends Panel
{
........
public void paint(Graphics g)
{
g.drawLine(n,n,n,n)...etc.;
}
}

I then, of course, construct a Frame in the application's main() method, and
Frame.add(MyPanel); it.

This compiles w/out error, but nothing gets drawn at all in the MyPanel.

What is the best approach for Graphics fxn calls w/in a Java Application
(non-Applet)?
Please just post or email the response to me @ [email protected]