I am currently taking a programming class in high school focused on Java. We have started to get into Swing and GUI's and I am really liking creating GUI applications. So my question was:
A program I wrote displays a JFrame
with two buttons: Continue and Quit. I figured out how to set the quit action to the quit button but now I want to know how I cant create an ActionListener
and add it to the continue button. When it's clicked, it will display a simple message like "You Did It!".
What I was thinking was to create a method that will create a new JFrame
with that message. When the continue button is clicked it will call that method and display the message.
Is there an easy way to do this?
Any help would be awesome! Thank You!