Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1763 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  [ Java / Swing ] BoxLayout can't be shared [FIXED]

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[ Java / Swing ] BoxLayout can't be shared [FIXED]

n°135257
TBone
Pouet.
Posté le 06-05-2002 à 13:40:22  profilanswer
 

salut,
 
j'suis en train d'écrire (à la main) une petite interface en Swing  et j'ai un souci.
 
je voudrais créer une petite fenêtre d'info lorsque le user veut quitter l'appli alors qu'elle a des process qui tournent.
 
 
JDialog jDialog = new JDialog(frame, "Exiting ?", true);
 
// problème avec le setLayout
jDialog.getContentPane().setLayout(new BoxLayout(jDialog, BoxLayout.Y_AXIS));
 
// label
JLabel msgLabel = new JLabel("The application is running.\nDo you really want to exit ?" );
jDialog.getContentPane().add(msgLabel);
jDialog.setSize(300, 150);
jDialog.setResizable(false);
jDialog.show();
 
ça compile. mais dès que je lance le GUI et que je clique sur le bouton (situé ailleurs) (lié par événement) j'ai un stack d'erreurs qui déboule sur la console avec le ténébreux: "BoxLayout can't be shared"
 
je comprends bien ce que veut dire cela mais pourquoi me dit-il "shared" sachant que c'est un new BoxLayout(...)
 
note: j'utilise un autre BoxLayout ailleurs. c'est de là que ça vient ?

 

[jfdsdjhfuetppo]--Message édité par TBone le 06-05-2002 à 15:47:31--[/jfdsdjhfuetppo]


---------------
As the plane took off, the pilot turned to the co-pilot and said, “Have you ever flown solo?” Co-pilot: No. Typically I fly much higher than this.
mood
Publicité
Posté le 06-05-2002 à 13:40:22  profilanswer
 

n°135352
TBone
Pouet.
Posté le 06-05-2002 à 15:25:49  profilanswer
 

bah rien de neuf... je ne comprends pas. je vais changer mon Layout pour continuer... ce sera plus facile.


---------------
As the plane took off, the pilot turned to the co-pilot and said, “Have you ever flown solo?” Co-pilot: No. Typically I fly much higher than this.
n°135372
TBone
Pouet.
Posté le 06-05-2002 à 15:47:08  profilanswer
 

c'est réparé.
 
j'avais oublié de créer un JPanel dans mon JDialog... :sarcastic:


---------------
As the plane took off, the pilot turned to the co-pilot and said, “Have you ever flown solo?” Co-pilot: No. Typically I fly much higher than this.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  [ Java / Swing ] BoxLayout can't be shared [FIXED]

 

Sujets relatifs
[JAVA] Comment remonter un JScrollBarautomatiquement ??[JAVA] Quel logiciel pour creer des executables ?
[JAVA] mon JscrollBar descend tout seul !!![Java FAQ] Venez ajouter vos liens - Update 20/11/2003
Agencement des objets en Java dans un JTabbedPane()[Java] et SMTP
java en ligne de commande et CLASSPATH[JAVA] FileWriter
[JAVA, JEXT] On peut compiler là dedans ?comment faire ca?pro du php/mysql/java j'ai besoin de vous !?
Plus de sujets relatifs à : [ Java / Swing ] BoxLayout can't be shared [FIXED]


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR