Correction des derniers bugs
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
BIN
chatGit/bin/gui/FenetreModifPseudo.class
Normal file
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
@ -5,7 +5,7 @@
|
|||
"port": 8080
|
||||
},
|
||||
"config":{
|
||||
"interface": "wlan4",
|
||||
"interface": "wlan3",
|
||||
"portSrc": 26000,
|
||||
"portDest":26001
|
||||
}
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
@ -79,6 +79,7 @@ public class FenetreModifPseudo implements ActionListener {
|
|||
this.ok = new JButton("Continue");
|
||||
this.Cancel = new JButton("Cancel");
|
||||
this.ok.addActionListener(this);
|
||||
this.ok.setSelected(false);
|
||||
this.Cancel.addActionListener(this);
|
||||
|
||||
//On associe au bouton Connexion des actions a realiser
|
||||
|
@ -104,15 +105,24 @@ public class FenetreModifPseudo implements ActionListener {
|
|||
|
||||
//Si le nouveau pseudo est acceptable
|
||||
if(agent.changerPseudo(newPseudo)) {
|
||||
|
||||
//Affichage message
|
||||
JOptionPane.showMessageDialog(frame, "Your new pseudo is "+newPseudo);
|
||||
frame.dispose();
|
||||
new FenetreMenu(agent);
|
||||
|
||||
//Sinon affichage message erreur
|
||||
}else {
|
||||
if(!ok.isSelected() && !FenetreMenu.ouvert) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
JOptionPane.showMessageDialog(frame, "Pseudo already use, choose another one");
|
||||
ok.setSelected(true);
|
||||
frame.dispose();
|
||||
new FenetreModifPseudo(agent);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (HeadlessException e1) {
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |