java swing button code example
Example 1: how to create a button in java
JButton button = new JButton();
Example 2: java swing button on click
JButton b = new JButton("push me");
b.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//your actions
}
});