A JButton gives the user the capability of performing an action at any time. The button is constructed with a label that suggests the nature of the action.
button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { code to implement response to user click. } });