You added your JButton to the JPanel but not the JPanel to the JFrame. Along with posting the error message, please also post the code in text so i can copy paste it into my IDE.