Below is my code; coinciding with that how would i import an image and make it the background of my program. I have tried the drawing method but it failed. I was wondering if someone could help me?
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();
}
}
Aucun commentaire:
Enregistrer un commentaire