How do I do simple graphics when I press a button?
I'm new to graphics and I want to draw on a JPanel when the user presses a button (or something else under program control).
I tried
privatevoid DrawPoints(){
int x, y;
x=10;
y=10;
final Graphics g = jPanel.getGraphics();
g.fillOval(x-2, y-2, 4, 4);
}
The debugger tells me that This element neither has attached source nor attached Javadoc and hence no information could be found for the getGraphics.
I want to tell it: OK, the purpose of this jPanel is to draw graphics. How do I tell it, or convince it to let me draw on the panel?
Thanks,
Ilan

