Program 8 - using Swing
You will write a program that creates a panel with 4 buttons in
2x2 grid. All 4 buttons will be initially labeled with the number 0.
When either button in the first row is clicked, the value on the button
will be increased by 1.
For the buttons in the second row, the first button (that is, the
button in row 2 and column 1) should always be labeled with the sum of
the values on the buttons in row 1. The second button (i.e., the button
in row 2, column 2) should always be labeled with the product of the
values on the buttons in row 1.
You must create a JFrame object, and add a JPanel object to the JFrame
object. The panel must use a Grid layout with 2 rows and 2 columns.
The frame must be closeable and visible. You must handle button
clicks on the two buttons in the first row as indicated above.
Submit MyGUI.java by midnight on December 5, 2008. You may not use slip days for this project.