hi everybody, so far i have created a GUI that shows a message board and beside it has textfields and areas for the user to enter their name, title of their message and the message itself. i also have functional quit buttons to exit the GUI and a clear button to reset all textfields and areas to having no text. my problem now is that i am trying to make an "add message" button so that once clicked the message will be displayed on the message board. as yet, i have had zero luck with this. can anybody please suggest some code to help me out. thanks in advance
Hentay's code is assuming the class that it is in implements the ActionListener interface. Also you would need to check the ActionEvent passed in to make sure the action that fired is from the "Add" Button.
You also want to seperate the ActionListener from the View, this is coupling the business logic to the view. But that is another discussion. The basics of what Hentay posted is what you want.