import java.awt.*; import javax.swing.*; public class AddAButton { public AddAButton () { JFrame frame = new JFrame("Add A Button"); frame.setSize(300,300); Container content = frame.getContentPane(); JButton button = new JButton("Look at Me"); button.setToolTipText("I am a JButton."); content.add(button); frame.setVisible(true); } public static void main(String[] args) { new AddAButton(); } }