public void run() { logger.error("Exception!",ex); try { String exceptionMessages = ExceptionUtil.getMessages(ex); JOptionPane.showMessageDialog(parentComponent, "Exception! See log (usually also printed to console)\n"+exceptionMessages,"An error occurred",JOptionPane.ERROR_MESSAGE); } catch(Exception xx){} } };
/** * @param args * 1st argument = output directory. * 2nd argument = C&C executable (path) * 3rd argument = C&C models directory * @return */ public static void main(String[] args) { try { if (args.length<3) throw new Exception("args. 1st argument should be a directory to put output images. 2nd - program. 3rd - models"); CandCDemoGui gui = new CandCDemoGui(args[0],args[1],args[2]); gui.init(); } catch(Exception e) { System.out.println("================================="); System.out.println("An exception occured!"); System.out.println(ExceptionUtil.getMessages(e)); System.out.println("========== stack trace =========="); e.printStackTrace(); } }
/** * @param args */ public static void main(String[] args) { try { if (args.length<3) throw new Exception("args. 1st argument should be a directory to put output images. 2nd - program. 3rd - models"); CandCDemo demo = new CandCDemo(new File(args[0]),args[1],args[2]); demo.start(); demo.readAndParse(); } catch(Exception e) { System.out.println("================================="); System.out.println("An exception occured!"); System.out.println(ExceptionUtil.getMessages(e)); System.out.println("========== stack trace =========="); e.printStackTrace(); } }
System.out.println(ExceptionUtil.getMessages(ex)); System.out.println("========== stack trace =========="); ex.printStackTrace();