Error: javax.swing.AbstractButton cannot be applied to...
Hi, iv written a program which has a JtabbedPane GUI but the problem is on one of my tabs i have a JPanel called panel1. on panel1 i have a button called addButton now i add this button onto my panel and my panel onto the tab using the following code:
Code:
panel1.add(addButton);
tabbedPane.addTab("New Booking", null, panel1, "First Panel");
which works just fine and when compiled you see the tabs and the button on the first pane.
but then when i try and ad an actionlistener to the button using the following code
Code:
addButton.addActionListener(this);
i get this error:
Code:
addActionListener(java.awt.event.ActionListener) in javax.swing.AbstractButton cannot be applied to (tester)
tester is the name of my class.
Thanks