Home Segments Top Top Previous Next

918: Mainline

The constructor for the JButton class produces a button labeled by the constructor's argument, a string. Thus, the following produces a button labeled with a plus sign, and assigns that button to the button1Plus instance variable:

button1Plus = new JButton("+");