Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExamplePanel extends JPanel implements ActionListener
- {
- private JButton button;
- private ActionListener buttonListener;
- public ExamplePanel(ActionListener buttonListener)
- {
- this.button = new JButton("Do Something");
- this.buttonListener = buttonListener;
- this.button.addListener(this.buttonListener);
- }
- public void actionPerformed(ActionEvent e)
- {
- this.buttonListener.actionPerformed(e);
- }
- }
Add Comment
Please, Sign In to add comment