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

View file

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