# Chuckle Clicker
We are going to tell the user jokes that have punchlines.
Make a ChuckleClicker class with a main method and a makeButtons() method. Open a pop-up that shows the message "Make Buttons" in the makeButtons method, to prove that it is working. (You will need to instantiate your class before you can call the method).
Now change the makeButtons() method, to make a JFrame and get it to show.
3.Add a JPanel and two JButtons to the frame, so it looks a lot like this:
*[Optional] Customize your GUI with setText, setSize, etc.
Make a pop-up that says “hi” when either of the buttons are pressed. You will need to add listeners to the buttons for this to work.
Check if the ActionEvent came from the joke button or the punchline button. if(event.getSource() == jokeButton) Hint: You might need to move the declaration of your buttons outside of the makeButtons() method.
Use JOptionPane to print the joke or the punchline depending on which button was clicked.
← 99 Extra 02 Jeopardy →