1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Test {
public static void main(String[] args) {
Fenetre fen = new Fenetre();
}
public class Fenetre extends JFrame {
public Fenetre() {
this.setTitle("Test !");
this.setSize(400,500);
this.setLocationRelativeTo(null);
JPanel pan = new JPanel();
pan.setBackground(Color.orange);
this.setContentPane(pan);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}
} |
Partager