Don't draw directly in a JFrame. Instead you're better off drawing in the paintComponent method of a JPanel and placing that JPanel in your JFrame. Even better for your situation is to simply make an ImageIcon out of your BufferedImage, placing this into a JLabel and displaying the JLabel.

Don't draw directly in a JFrame. Instead you're better off drawing in the paintComponent method of a JPanel and placing that JPanel in your JFrame. Even better for your situation is to simply make an ImageIcon out of your BufferedImage, placing this into a JLabel and displaying the JLabel.