Bonjour,
Je cherche avec ce code a creer une nouvelle fenetre lors d'un click d'un bouton de menu. L'evenement marche.
Voici ma procedure:
JFrame fen_apropos = new JFrame(); fen_apropos.setTitle("A propos"); fen_apropos.setSize(300,300); fen_apropos.setDefaultCloseOperation(fen_apropos.HIDE_ON_CLOSE); //mode de fermeture fen_apropos.setLocationRelativeTo(this.getParent()); //centrage de la fenetre par rapport a la fenetre parent (ici l'ecran) Container apropos_conteneur = fen_apropos.getContentPane(); //Creation du container de composants JLabel apropos_label = new JLabel("A propos"); apropos_label.setHorizontalTextPosition(1000); apropos_label.setHorizontalAlignment(100); apropos_conteneur.add(apropos_label, BorderLayout.CENTER); fen_apropos.setVisible(true);
|
D'ou peux venir mon erreur?
D'avance merci de votre aide.
