How would I import an image and make it the background of my program?
I have tried the drawing method but it failed.
package Control;
import java.awt.Color;
import javax.swing.JFrame;
public class Control extends JFrame {
private static final long serialVersionUID = 1L;
public Control() {
setSize(500, 500);
setTitle("Asteroid: Save Humanity");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new Control();
}
}