Alternatively, you can extend JApplet (instead of Applet) and call the getContentPane().add(JButton...) method.