1 package hudson.jnlp; 2 3 import javax.swing.SwingUtilities ; 4 import javax.swing.JOptionPane ; 5 import java.io.StringWriter ; 6 import java.io.PrintWriter ; 7 8 11 public class Main { 12 13 public static void main(String [] args) { 14 System.setSecurityManager(null); 19 20 GUI.setUILookAndFeel(); 21 final MainDialog frame = new MainDialog(); 22 frame.setVisible(true); 23 24 Engine engine = new Engine(new Listener() { 25 public void status(final String msg) { 26 SwingUtilities.invokeLater(new Runnable () { 27 public void run() { 28 frame.status(msg); 29 } 30 }); 31 } 32 33 public void error(final Throwable t) { 34 SwingUtilities.invokeLater(new Runnable () { 35 public void run() { 36 StringWriter sw = new StringWriter (); 37 t.printStackTrace(new PrintWriter (sw)); 38 JOptionPane.showMessageDialog( 39 frame,sw.toString(),"Error", 40 JOptionPane.ERROR_MESSAGE); 41 System.exit(-1); 42 } 43 }); 44 } 45 }, args[0], args[1], args[2], args[3]); 46 engine.start(); 47 } 48 } 49 | Popular Tags |