add actionlistener

Java make Button Enabled

After learning GUI creation through 8 steps, for more command over button event handling, apart this one, another two programs are given – Changing Button Label and Making Button Invisible. In the following program, three buttons are created with labels Red, Green and Blue. When Red button is clicked, the…

Java AWT Button Learn GUI 8 Steps

The java.awt package comes with many GUI components of which Button is the most important and most frequently used. A button functionality (what for it is) can be known by its label like OK or Cancel etc. A mouse click on the button generates an action. Following is the class…