Fast fertig IP-Einstellung fehlt noch

This commit is contained in:
nobody
2019-05-29 11:17:12 +02:00
parent eddd07057b
commit 78af656f78
6 changed files with 135 additions and 85 deletions
+13 -7
View File
@@ -10,6 +10,7 @@ import controller.ConnectController;
import controller.ReceiveAdapter;
import controller.SendController;
import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.CLOSED_OPTION;
import javax.swing.UIManager;
import model.Transmitter;
import view.ChatView;
@@ -25,7 +26,7 @@ public class Start
//Auswahl für Server oder Client
String[] options = {"Server","Client"};
int entscheidung = JOptionPane.showOptionDialog(null, "Server oder Client Modus?","Auswahl des Operationmoduses",JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
if(entscheidung > 1)
if(entscheidung == CLOSED_OPTION)
{
JOptionPane.showMessageDialog(null, "Unbekannter Fehler");
System.exit(0);
@@ -33,18 +34,23 @@ public class Start
//
ChatView view = new ChatView();
if(entscheidung==0) view.setTitle("Server");
if(entscheidung==1) view.setTitle("Client");
Transmitter model = new Transmitter(entscheidung);
ConnectController conncontroller = new ConnectController();
SendController sendcontroller = new SendController(view);
ConnectController conncontroller = new ConnectController(view,model);
Thread chatter = new Thread(model);
chatter.start();
SendController sendcontroller = new SendController(view,model);
sendcontroller.registerEvents();
ReceiveAdapter adapter = new ReceiveAdapter(model);
ReceiveAdapter adapter = new ReceiveAdapter(view,model);
adapter.registerEvents();
view.setVisible(true);
model.run();
}
/**
* @param args the command line arguments