Handling Action Events

Action events are fired by subclasses of AbstractButton and includes buttons, checkboxes, and menus.
AbstractButton button = new JButton("OK");
button.addActionListener(new MyActionListener());

public class MyActionListener implements ActionListener {
    public void actionPerformed(ActionEvent evt) {
        // Determine which abstract button fired the event.
        AbstractButton button = (AbstractButton)evt.getSource();
    }
}

Comments

11 Jun 2010 - 8:08am by Anonymous (not verified)

I am trying to generate a functionality where I am able to view a form at the click of a button(view button)

29 Jun 2010 - 1:23am by Anonymous (not verified)

I want to know how to connect multiple tables to one interface with an MDI form so that when i click a button it takes me to the forms

7 Nov 2011 - 5:52pm by oakley hijinx sunglasses (not verified)

discount oakley bottlecap sunglasses oakley bottlecap sunglasses sale oakley mens bottlecap sunglasses oakley fives sunglasses discount oakley fives sunglasses YangGengSheng

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.