Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyButton extends JButton implements ActionListener {
- public MyButton(String s){
- super(s);
- addActionListener(this);
- }
- @Override
- public void actionPerformed(ActionEvent e) {
- System.out.println("You pressed the button!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement