Fertig
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package chatprogramm;
|
||||
|
||||
import controller.ConnectController;
|
||||
import controller.ReceiveAdapter;
|
||||
import controller.SendController;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.UIManager;
|
||||
import model.Transmitter;
|
||||
import view.ChatView;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Apollo
|
||||
*/
|
||||
public class Start
|
||||
{
|
||||
public 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)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Unbekannter Fehler");
|
||||
System.exit(0);
|
||||
}
|
||||
//
|
||||
|
||||
ChatView view = new ChatView();
|
||||
Transmitter model = new Transmitter(entscheidung);
|
||||
ConnectController conncontroller = new ConnectController();
|
||||
|
||||
SendController sendcontroller = new SendController(view);
|
||||
sendcontroller.registerEvents();
|
||||
|
||||
ReceiveAdapter adapter = new ReceiveAdapter(model);
|
||||
|
||||
view.setVisible(true);
|
||||
|
||||
model.run();
|
||||
|
||||
}
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
|
||||
if ("Nimbus".equals(info.getName())) {
|
||||
UIManager.setLookAndFeel(info.getClassName());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Fehler beim Aufrufen der Syseinstellungen");
|
||||
}
|
||||
new Start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user