1 19 20 package taskblocks.app; 21 22 import java.io.File ; 23 import java.net.URL ; 24 25 import javax.swing.ImageIcon ; 26 import javax.swing.SwingUtilities ; 27 28 public class TaskBlocks { 29 30 static final boolean RUNNING_ON_MAC = System.getProperty("os.name") 31 .toLowerCase().startsWith("mac os x"); 32 33 static final boolean RUNNING_ON_WINDOWS = System.getProperty("os.name") 34 .toLowerCase().startsWith("windows"); 35 36 public TaskBlocks(final String [] args) { 37 38 System.setProperty("apple.laf.useScreenMenuBar", "true"); 39 System.setProperty("com.apple.mrj.application.growbox.intrudes", 40 "false"); 41 System.setProperty("com.apple.mrj.application.live-resize", "true"); 42 43 SwingUtilities.invokeLater(new Runnable () { 44 public void run() { 45 if (args.length > 0) { 46 for (int i = 0; i < args.length; i++) { 47 new ProjectFrame().openFile(new File (args[i])); 48 } 49 } else { 50 new ProjectFrame(); 51 } 52 } 53 }); 54 } 55 56 public static void main(String args[]) { 57 new TaskBlocks(args); 58 } 59 60 public static ImageIcon getImage(String name) { 61 URL url = ProjectFrame.class.getResource("/taskblocks/img/" + name); 62 if (url == null) { 63 return null; 64 } 65 return new ImageIcon (url); 66 } 67 68 } 69 | Popular Tags |