public static void main(String[] argv) { MainWindow win; DbgOutput.toStdout(); win = new MainWindow(); // process cmd line arguments int i; for (i = 0; i < argv.length; i++) { if (argv[i].equals("-D")) { i++; // try to interpret the next argument as the debug level int dbgLvl = 1; // basic debug level if (i >= argv.length) { // no more arguments, we stick with debug level 1 break; } try { dbgLvl = Integer.parseInt(argv[i]); } catch (NumberFormatException e) { dbgLvl = 1; // didn't work, this is probably a filename win.open(argv[i]); } DbgOutput.setDbgLevel(dbgLvl); Libgist.setDbgLevel(dbgLvl); } else if (argv[i].equals("-h")) { // print help message and exit System.out.println("Usage: amdb [-D <dbglevel> | -h] [index]"); System.exit(0); } else { // this is a name of an index, open it // System.out.println("open " + argv[i]); win.open(argv[i]); } } win.setTitle("amdb"); win.setSize(800, 600); win.setLocation(50, 50); win.setVisible(true); }
public static void main(String[] args) { String osName = System.getProperty("os.name"); if (osName != null && !osName.equals("")) { if (osName.toLowerCase().contains("windows")) { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } } } MainWindow mainWindow = new MainWindow(); mainWindow.setTitle("Jar Class Finder"); URL url = Launcher.class.getClassLoader().getResource("cn/jun/image/JarClassFinderLogo.png"); ImageIcon imageIcon = new ImageIcon(url); Image image = imageIcon.getImage(); mainWindow.setIconImage(image); mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainWindow.setVisible(true); }