You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Start.java 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package netz;
  7. import java.io.IOException;
  8. import java.net.MalformedURLException;
  9. import java.net.URL;
  10. import javax.swing.JFrame;
  11. import javax.swing.WindowConstants;
  12. import netz.controller.BtnController;
  13. import netz.controller.ChatController;
  14. import netz.model.ChatModel;
  15. import netz.view.ChatView;
  16. /**
  17. * Builder Class
  18. * @author chris, hd
  19. */
  20. public class Start
  21. {
  22. public Start() throws MalformedURLException, IOException
  23. {
  24. // URL oUrl = new URL(urlString + "/" + dateiname);
  25. // InputStream iStream = oUrl.openStream();
  26. // BufferedInputStream in = new BufferedInputStream(iStream);
  27. //
  28. // String tmpVerzeichnis = System.getProperty("java.io.tmpdir");
  29. // String ausgabeDateiname = tmpVerzeichnis + File.separator + dateiname;
  30. //
  31. // FileOutputStream fos = new FileOutputStream(ausgabeDateiname);
  32. // BufferedOutputStream out = new BufferedOutputStream(fos);
  33. //
  34. // int wert = 0;
  35. //
  36. // while ( (wert = in.read()) >= 0)
  37. // {
  38. // out.write(wert);
  39. // }
  40. // in.close();
  41. // out.close(); // flush!
  42. // System.out.println("Datei " + ausgabeDateiname + " erfolgreich erstellt");
  43. JFrame frm = new JFrame();
  44. frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  45. ChatView view = new ChatView();
  46. ChatModel model = new ChatModel();
  47. BtnController btncontroller = new BtnController(view, model);
  48. ChatController chatcontroller = new ChatController(view, model);
  49. btncontroller.registerEvents();
  50. chatcontroller.registerEvents();
  51. view.setSize(800, 600);
  52. view.setVisible(true);
  53. }
  54. public static void main(String[] args)
  55. {
  56. try
  57. {
  58. new Start();
  59. }
  60. catch (Exception ex)
  61. {
  62. System.err.println(ex);
  63. ex.printStackTrace();
  64. }
  65. try
  66. {
  67. new Start();
  68. }
  69. catch (Exception ex)
  70. {
  71. System.err.println(ex);
  72. ex.printStackTrace();
  73. }
  74. }
  75. }