Hi all
Is this a legit if statement. It is a button that changes a ball colour from blue to red on a click. And also display the colour in a text field. I have experimented several methods but can't get it to work. test is an int set to 0.
void jButton1_mouseClicked(MouseEvent e) {
if (test < 1)
(aBall.color = (color.red)); test--; jTextField1.setText("Blue");
else
(aBall.color = (color.blue)); test++; jTextField1.setText("Red");
repaint();
}
Cheers


Reply With Quote
Got that working, thanks.



Bookmarks