I have a canvas and I want to draw a rectangle based on a JButton click.
So in other words
private void jb_drawActionPerformed(ActionEvent evt) {
// draw a rectangle method
}
Basically, how do I encorporate the pain(Graphics g) thingamagic in that method? or should I make the rectangle an object and call a "render" method from that object? If so, can someone link a tut?
private void jb_drawActionPerformed(ActionEvent evt) {
myrectange.render(x,y); // ????
}