ViceroyFizzlebottom
asked on
Button event handling in JApplet
Hey there. I have an applet that has some input textboxes and two buttons.
The general format is this:
public class Install extends JApplet implements ActionListener
{}
Anyway, I'm having a hard time figuring out how to handle the button clicks as far as how to implement the
actionPerformed() method. Where should the actionPerformed method be defined and what is the best way
to handle the two button events?
Any help is appreciated.
The general format is this:
public class Install extends JApplet implements ActionListener
{}
Anyway, I'm having a hard time figuring out how to handle the button clicks as far as how to implement the
actionPerformed() method. Where should the actionPerformed method be defined and what is the best way
to handle the two button events?
Any help is appreciated.
For more information: http://java.sun.com/docs/books/tutorial/uiswing/components/button.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This sample code is for JComboBox but the same style of getting / handling the event can applied on JButton.
Basically you need to call addActionListener(actionLi
that will handle the event.