le commit sournois

This commit is contained in:
Theau Giraud 2020-12-15 17:48:41 +01:00
parent 986ad70f27
commit 2562a1ed3b
2 changed files with 17 additions and 7 deletions

View file

@ -69,6 +69,12 @@ public class Controller {
this.tcp_connect_thread.start(); this.tcp_connect_thread.start();
notify_remote_users(); notify_remote_users();
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
hisView.createAndShowGUI();
}
});
} }
/** /**
@ -160,6 +166,7 @@ public class Controller {
//sc1.close(); //sc1.close();
JOptionPane.showMessageDialog(null ,"Your nickname : " + tmpPseudo + " is valid !"); JOptionPane.showMessageDialog(null ,"Your nickname : " + tmpPseudo + " is valid !");
hisView.Pseudolabel.setText("Your current username is: " + tmpPseudo);
return tmpPseudo; return tmpPseudo;
} }

View file

@ -4,17 +4,20 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.IOException; import java.io.IOException;
import controller.Controller;
public class Interface implements ActionListener { public class Interface implements ActionListener {
public Controller hisController;
private JLabel Pseudolabel; public JLabel Pseudolabel;
private JTextField PseudotextField; public JTextField PseudotextField;
private JLabel Messagelabel; public JLabel Messagelabel;
private JTextField MessagetextField; public JTextField MessagetextField;
private JButton RemoteUserButton; public JButton RemoteUserButton;
private JLabel RemoteUserlabel; public JLabel RemoteUserlabel;
//Specifies the look and feel to use. Valid values: //Specifies the look and feel to use. Valid values:
//null (use the default), "Metal", "System", "Motif", "GTK+" //null (use the default), "Metal", "System", "Motif", "GTK+"
@ -125,7 +128,7 @@ public class Interface implements ActionListener {
* this method should be invoked from the * this method should be invoked from the
* event-dispatching thread. * event-dispatching thread.
*/ */
private static void createAndShowGUI() { public static void createAndShowGUI() {
//Set the look and feel. //Set the look and feel.
initLookAndFeel(); initLookAndFeel();