/* * 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 netz; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.swing.JFrame; import javax.swing.WindowConstants; import netz.controller.BtnController; import netz.controller.ChatController; import netz.model.ChatModel; import netz.view.ChatView; /** * Builder Class * @author chris, hd */ public class Start { public Start() throws MalformedURLException, IOException { // URL oUrl = new URL(urlString + "/" + dateiname); // InputStream iStream = oUrl.openStream(); // BufferedInputStream in = new BufferedInputStream(iStream); // // String tmpVerzeichnis = System.getProperty("java.io.tmpdir"); // String ausgabeDateiname = tmpVerzeichnis + File.separator + dateiname; // // FileOutputStream fos = new FileOutputStream(ausgabeDateiname); // BufferedOutputStream out = new BufferedOutputStream(fos); // // int wert = 0; // // while ( (wert = in.read()) >= 0) // { // out.write(wert); // } // in.close(); // out.close(); // flush! // System.out.println("Datei " + ausgabeDateiname + " erfolgreich erstellt"); JFrame frm = new JFrame(); frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); ChatView view = new ChatView(); ChatModel model = new ChatModel(); BtnController btncontroller = new BtnController(view, model); ChatController chatcontroller = new ChatController(view, model); btncontroller.registerEvents(); chatcontroller.registerEvents(); view.setSize(800, 600); view.setVisible(true); } public static void main(String[] args) { try { new Start(); } catch (Exception ex) { System.err.println(ex); ex.printStackTrace(); } try { new Start(); } catch (Exception ex) { System.err.println(ex); ex.printStackTrace(); } } }