Skip to content

Instantly share code, notes, and snippets.

@why-jay
Created December 13, 2014 15:44
Show Gist options
  • Save why-jay/6229ac57a4d7f40fa0c2 to your computer and use it in GitHub Desktop.
Save why-jay/6229ac57a4d7f40fa0c2 to your computer and use it in GitHub Desktop.
JPanel panel = new JPanel();
panel.add(new JButton(new AbstractAction("name of button") {
public void actionPerformed(ActionEvent e) {
//do stuff here
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment