previous | index | next

Writing Handler Code

NetBeans will automatically create an action listener that calls a handler method whose body you provide in the source.

Type the following code into the body of jButton1ActionPerformed:

     if ( jButton1.getText().equals("PUSH ME")) {
         jButton1.setText("THANK YOU");
     }
     else {
         jButton1.setText("PUSH ME");
     }

previous | index | next