standard + connexion
This commit is contained in:
parent
a1531eebb5
commit
79d50ea36d
4 changed files with 14 additions and 14 deletions
|
@ -5,6 +5,7 @@ import java.awt.event.ActionListener;
|
|||
import java.io.IOException;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
|
||||
import communication.*;
|
||||
|
||||
public class ControleurConnexion implements ActionListener, Observer{
|
||||
|
@ -34,7 +35,7 @@ public class ControleurConnexion implements ActionListener, Observer{
|
|||
this.comUDP = new CommunicationUDP(2408, 2409, new int[] {2209, 2309});
|
||||
break;
|
||||
default :
|
||||
this.comUDP = new CommunicationUDP(2308, 2309, new int[] {2209, 2409});
|
||||
this.comUDP = new CommunicationUDP(2408, 2409, new int[] {2209, 2309});
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -105,8 +106,7 @@ public class ControleurConnexion implements ActionListener, Observer{
|
|||
e1.printStackTrace();
|
||||
}
|
||||
try {
|
||||
//Ne se ferme pas ???????
|
||||
vue.dispose();
|
||||
vue.close();
|
||||
new VueStandard("Standard", comUDP);
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
|
|
|
@ -86,7 +86,7 @@ public class ControleurStandard implements ActionListener, ListSelectionListener
|
|||
VueStandard.userList.removeAllElements();
|
||||
Utilisateur.getSelf().setPseudo("");
|
||||
vue.dispose();
|
||||
new VueConnexion(0);
|
||||
new VueConnexion(5);
|
||||
/*this.vue.toggleEnableButtonConnexion();
|
||||
this.vue.toggleEnableButtonDeconnexion();*/
|
||||
} catch (IOException e1) {
|
||||
|
|
|
@ -10,6 +10,7 @@ public class Vue extends JFrame{
|
|||
|
||||
public void reduireAgent() {}
|
||||
|
||||
public void fermerAgent() {}
|
||||
|
||||
public void close() {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import javax.swing.*;
|
|||
public class VueConnexion extends Vue {
|
||||
|
||||
//Elements vue
|
||||
private JFrame frame;
|
||||
private JPanel panel;
|
||||
private JButton boutonValider;
|
||||
private JTextField input;
|
||||
|
@ -17,15 +16,15 @@ public class VueConnexion extends Vue {
|
|||
//Controleur
|
||||
ControleurConnexion controle;
|
||||
|
||||
//penser à enlever le numtest
|
||||
public VueConnexion(int numtest) {
|
||||
super("Connexion");
|
||||
controle = new ControleurConnexion(this, numtest);
|
||||
|
||||
//Creation fenetre
|
||||
frame = new JFrame("Connexion");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setSize(400, 100);
|
||||
frame.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setSize(400, 100);
|
||||
this.setLocationRelativeTo(null);
|
||||
|
||||
//Creation panel
|
||||
panel = new JPanel(new GridLayout(3,1));
|
||||
|
@ -34,13 +33,13 @@ public class VueConnexion extends Vue {
|
|||
ajouterElements();
|
||||
|
||||
//Regle le bouton par défaut
|
||||
frame.getRootPane().setDefaultButton(boutonValider);
|
||||
this.getRootPane().setDefaultButton(boutonValider);
|
||||
|
||||
//Ajoute le panel a la fenetre
|
||||
frame.getContentPane().add(panel, BorderLayout.CENTER);
|
||||
this.getContentPane().add(panel, BorderLayout.CENTER);
|
||||
|
||||
//Affiche la fenetre
|
||||
frame.setVisible(true);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
private void ajouterElements() {
|
||||
|
|
Loading…
Reference in a new issue