Hey all,
I am trying to use a button to trigger an animation on a JPanel. For starters, I want to draw a circle, but when I fire the event, the new circle is not displayed. Here is a toy clone:
JButton button = new JButton("GO");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
runFoo();
}
});
public void runFoo() {
repaint();
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.drawOval(myX, myY, 50,50);
}
Thank you all,
Rob Kallman