JDialog contenu invisible sous windows
Bonjour à tous,
J'ai un soucis avec un JDialog qui me sert à paramétrer une partie.
Chez moi, sur mon Ubuntu avec un java version "1.6.0_24" cette JDialog apparaît correctement, tandis que sur mon windows, et sur ceux de d'amis, la fenêtre reste bien vide...
Où peut bien être le problème???
Ps : j'ai bien sur juste allégé le code ici en enlevant les répétitions de combo/label/jtext
Code:
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| public class Lanceur extends JDialog {
/**
*
*/
private static final long serialVersionUID = 1L;
JComboBox combo1 = new JComboBox();
JComboBox combo2 = new JComboBox();
JComboBox combo3 = new JComboBox();
JComboBox combo4 = new JComboBox();
JComboBox combo5 = new JComboBox();
JComboBox combo6 = new JComboBox();
JTextField jtf1 = new JTextField("");
JTextField jtf2 = new JTextField("");
JTextField jtf3 = new JTextField("");
JTextField jtf4 = new JTextField("");
JTextField jtf5 = new JTextField("");
JTextField jtf6 = new JTextField("");
JLabel label1 = new JLabel("Joueur 1");
JLabel label2 = new JLabel("Joueur 2");
JLabel label3 = new JLabel("Joueur 3");
JLabel label4 = new JLabel("Joueur 4");
JLabel label5 = new JLabel("Joueur 5");
JLabel label6 = new JLabel("Joueur 6");
JPanel pan;
PartieThread p;
public Lanceur(JFrame parent, String title, boolean modal, PartieThread p){
super(parent, title, modal);
this.p=p;
this.setSize(400, 250);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.setVisible(true);
this.add(initComponent());
}
JPanel initComponent(){
pan = new JPanel();
combo1.setPreferredSize(new Dimension(150, 20));
combo1.addItem("");
combo1.addItem("Joueur Réel");
combo1.addItem("Joueur Virtuel");
combo1.setForeground(Color.blue);
jtf1.setPreferredSize(new Dimension(150, 20));
pan.add(label1);
pan.add(combo1);
pan.add(jtf1);
JButton okBouton= new JButton("OK");
okBouton.addActionListener(new BoutonListener());
pan.add(okBouton);
return pan;
}
class BoutonListener implements ActionListener{
public void actionPerformed(ActionEvent e) {
setVisible(false);
lancement();
// pan.setVisible(false);
}
}
public void lancement(){
p.instancierLesJoueurs(combo1.getSelectedItem().toString(), jtf1.getText(), combo2.getSelectedItem().toString(), jtf2.getText(), combo3.getSelectedItem().toString(), jtf3.getText(), combo4.getSelectedItem().toString(), jtf4.getText(), combo5.getSelectedItem().toString(), jtf5.getText(), combo6.getSelectedItem().toString(), jtf6.getText());
p.lancerLaPartieDeJeu();
}
} |
Merci d'avance je bloque vraiment et je n'ai rien trouvé :?