Add a button to the frame
Finally, Listing 4
- Instantiates a new BaldButton object
- Sets the text on the button to A
- Adds that new object to the frame
This button appears as the leftmost button in the GUI shown in
Figure 2, because:
- The layout property of the frame has been set to FlowLayout
- This is the first component added to the frame