As mentioned before, you have to write Event or Action listeners to give your buttons the ability to actually do anything. These listeners wait for a certain type of event to happen. When such an event happens, the ActionListener executes the code you wrote inside it.
This is an example of an action listener. You will notice that the new keyword is used. This is because you are instantiating an anonymous (or inner) class.
button.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("Button clicked."); } } );