|
Why does nothing happen when you click the button? A good answer might be:There is no listener for the Button's events. If there is no listener for a particular type of event, then the program will simply ignore events of that type. | |
How to add ButtonsThere is a listener for the frame's "close button," but not for the new Button. You can click the Button, and generate an event, but no listener receives the event.
The program in the previous chapter does not define a constructor because it inherits the constructor from its parent class (Frame), which is enough to do the job. When you add components to a container, you will have to define a constructor for the container class. | |
QUESTION 3:First let us look at the problem of the button that fills the frame. What size to you think would be better for the button? Where do you think the button should go? Click Here after you have answered the question |