Java Reference
In-Depth Information
Display 18.9
Labels with Changing Visibility
(part 3 of 3)
56
if
(actionCommand.equals("Wave"))
57
{
58
wavingLabel.setVisible(
true
);
59
standingLabel.setVisible(
false
);
60
}
61
else if
(actionCommand.equals("Stop"))
62
{
63
standingLabel.setVisible(
true
);
64
wavingLabel.setVisible(
false
);
65
}
66
else
67
System.out.println("Unanticipated error.");
68
}
69
}
R
ESULTING
GUI
(After clicking Stop button)
R
ESULTING
GUI
(After clicking Wave button)
18.3
The
Graphics
Class
Drawing is my life!
The
Graphics
class
In this section we show you how to produce drawing for your GUIs using the
Graphics
class.