123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /*
- * 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 chatProg;
-
- import javax.swing.JFrame;
- import javax.swing.WindowConstants;
- import chatProg.controller.ReceiveAdapter;
- import chatProg.controller.CommandConnect;
- import chatProg.controller.CommandSend;
- import chatProg.model.ChatModel;
- import chatProg.view.ChatView;
- import java.util.logging.Logger;
- import javax.swing.JOptionPane;
- import javax.swing.UIManager;
- import chatProg.logger.OhmLogger;
-
-
- /**
- * Builder Class
- * @author chris, hd
- */
- public class Start
- {
- private static Logger lg = OhmLogger.getLogger();
-
- public Start()
- {
-
- JFrame frm = new JFrame();
- frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-
- ChatView view = new ChatView();
- ChatModel model = new ChatModel();
-
- 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);
-
- }
-
- public static void main(String[] args)
- {
- try
- {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- catch (Exception ex)
- {
- JOptionPane.showMessageDialog(null, ex.toString());
- }
- new Start();
- new Start();
-
- }
- }
|