Painting via JButton Events
I am using Swing to create Jbuttons on a JPanel. My aim is for a button to be clicked which responds by painting a graphic (eg a rectangle) on a JPanel.
When I add a ActionListener() to a button and define the actionPerformed() for it, how do I call the following so that it draws the rectangle on the panel?
public void paint (Graphics g) {
g.setColor(blue);
g.drawRect(25, 110, 150, 80);}
Simple problem I guess...Thanks for the help...

