I am on the controller side of my application and I am having a issue with adding a actionListener to my JTextArea.
package addItemBtn.Home.DataBase; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; public class AddItemController { private AddItemModel model; private AddItemView view; AddItemController() { //adding actionListeners for the AddItemClass view.cancelBtn.addActionListener(new ActionListeners()); view.submitBtn.addActionListener(new ActionListeners()); view.previewBtn.addActionListener(new ActionListeners()); view.nameBox.addActionListener(new ActionListeners()); view.priceBox.addActionListener(new ActionListeners()); view.locationBox.addActionListener(new ActionListeners()); view.descriptionBox.addActionListener(new ActionListeners()); } class ActionListeners implements ActionListener { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub } } }
view.descriptionBox.addActionListener(new ActionListeners());//this is where my error is
Error states: The method addActionListener(AddItemController.ActionListener s) is undefined for the type JTextArea)
I clicked on each of the suggestions it gives me but it is still not working. Another things is I found examples on the web with people using actionListener with JTextArea..... Any advice?