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