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
|
@SuppressWarnings("serial")
public class Info extends JFrame implements ActionListener {
private JPanel container = new JPanel(new GridBagLayout());
private String text = "A PROPOS etc etc...";
private JTextArea JTA = new JTextArea(text, 10 , 10);
private JButton boutonPopup = new JButton("Fermer");
//private GridBagConstraints d = new GridBagConstraints();
public void actionPerformed(ActionEvent arg0) {
this.setTitle("A propos");
this.setSize(285, 400);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(HIDE_ON_CLOSE);
container.setBackground(Color.GRAY);
this.setVisible(true);
this.setContentPane(container);
container.add(JTA);
container.add(boutonPopup)
this.boutonPopup.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
System.out.println("fermer le popup");
//this.dispose(); // ????? :( :(
//container.hide(); // ????? :( :(
}
}); |