Browse Source

init

master
Hannes Dürr 3 years ago
parent
commit
9a8c3d67ee
2 changed files with 76 additions and 0 deletions
  1. 6
    0
      .gitignore
  2. 70
    0
      src/graphicChat/Start.java

+ 6
- 0
.gitignore View File

@@ -0,0 +1,6 @@
/build/
/nbproject/private/
*.xml
*.properties
*.mf
/dist/

+ 70
- 0
src/graphicChat/Start.java View File

@@ -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();
}
}

Loading…
Cancel
Save