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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
package aa;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class SimpleFenetre extends JFrame implements ActionListener {
private JPanel pan;
private JButton entrer= new JButton("entrer");
public SimpleFenetre(){
this.setResizable(false);
this.setSize(420,420);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pan=new Panneau();
pan.setBorder(BorderFactory.createTitledBorder("ulysse00"));
pan.setLayout(null);
entrer.addActionListener(this);
pan.add(entrer);
entrer.setBounds(150 ,100 ,70,30 );
getContentPane().add(pan);
}
class Panneau extends JPanel {
public Panneau() {
}
}
public static void main(String[] args) {
SimpleFenetre gui = new SimpleFenetre();
gui.setVisible(true);
}
} |
Partager