From 9a8c3d67ee57f796f2dd40fed151cc1933abfda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20D=C3=BCrr?= Date: Wed, 23 Dec 2020 09:51:54 +0100 Subject: [PATCH] init --- .gitignore | 6 ++++ src/graphicChat/Start.java | 70 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100755 src/graphicChat/Start.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d503523 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/build/ +/nbproject/private/ +*.xml +*.properties +*.mf +/dist/ diff --git a/src/graphicChat/Start.java b/src/graphicChat/Start.java new file mode 100755 index 0000000..e008cfc --- /dev/null +++ b/src/graphicChat/Start.java @@ -0,0 +1,70 @@ +/* + * 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 graphicChat; + +import javax.swing.JFrame; +import javax.swing.WindowConstants; +import graphicChat.controller.CommandConnect; +import graphicChat.controller.CommandSend; +import graphicChat.controller.GraphicsController; +import graphicChat.controller.ReceiveAdapter; +import graphicChat.view.ChatView; +import graphicChat.model.ChatModel; +import javax.swing.JOptionPane; +import javax.swing.UIManager; +/** + * Builder Class + * @author le + */ +public class Start +{ + public Start() + { + JFrame frm = new JFrame(); + frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + + ChatView view = new ChatView(); + ChatModel model = new ChatModel(); + view.getGrafikView1().setModel(model); + + GraphicsController controller = new GraphicsController(view.getGrafikView1(), model); + controller.registerEvents(); + + CommandConnect cmdConnect = new CommandConnect(view, model); + cmdConnect.registerEvents(); + + CommandSend cmdSend = new CommandSend(view, model); + cmdSend.registerEvents(); + + ReceiveAdapter recAdapter = new ReceiveAdapter(view, model); + recAdapter.subscribe(); + + view.setVisible(true); + view.setTitle("Chat"); + + view.setSize(800, 600); + view.setVisible(true); + + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) + { + try + { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } + catch (Exception ex) + { + JOptionPane.showMessageDialog(null, ex.toString()); + } + new Start(); + new Start(); + } +}