You could use an anonymous inner class, as stated above. Did you do any googling of that? Something like:
ActionListener al = new ActionListener(){
public void actionPerformed(ActionEvent e){...
Type: Posts; User: KevinWorkman
You could use an anonymous inner class, as stated above. Did you do any googling of that? Something like:
ActionListener al = new ActionListener(){
public void actionPerformed(ActionEvent e){...
Well, that's not valid syntax, and that's not what I suggested. Recommended reading: Lesson: Writing Event Listeners (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Edit- I see Sean4u...
You don't need to extend JPanel, but you do need an instance (I'm assuming of ActionListener) to pass into the method. Do that by implementing ActionListener in a class you actually instantiate or by...