Program’s Output



Eine gute Antwort könnte sein:

No. Often nothing changes.

Program’s Output

The Java system automatically
paints the frame
when any of several things has happened:

  • The frame has just been created.
  • The frame has been maximized.
  • The frame was previously hidden
    behind another frame and has just been exponsed.

However, a mere button click does not necessarily mean that a frame should be
repainted.
If it does (as it does in this program) call repaint()
in the actionPerformed() method.

The picture shows the output of the program.
The original frame is on the top.
On the bottom is the frame after the button has been clicked.
Additional clicks do nothing.
Although the events are handled,
all that happens is that the frame is set to blue each time.
Clicking on the frame’s “close window” button closes the frame.




FRAGE 16:


(Memory Test: ) What is the name of the method that receives
ActionEvents when a Button is clicked?