List of usage examples for java.lang System getProperties
public static Properties getProperties()
From source file:TreeNodeVector.java
public static void main(final String args[]) { JFrame frame = new JFrame("JTreeSample"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Vector<String> v1 = new TreeNodeVector<String>("Two", new String[] { "Mercury", "Venus", "Mars" }); Vector<Object> v2 = new TreeNodeVector<Object>("Three"); v2.add(System.getProperties()); v2.add(v1);/*from w w w .ja v a 2 s. c om*/ Object rootNodes[] = { v1, v2 }; Vector<Object> rootVector = new TreeNodeVector<Object>("Root", rootNodes); JTree tree = new JTree(rootVector); UIManager.put("Tree.line", Color.GREEN); tree.putClientProperty("JTree.lineStyle", "Horizontal"); frame.add(new JScrollPane(tree), BorderLayout.CENTER); frame.setSize(300, 300); frame.setVisible(true); }
From source file:test.SomeOtherMainClass.java
public static void main(String[] args) throws Exception { Configuration cfg = new Configuration(); cfg.size();/* w w w.java 2 s .co m*/ System.getProperties().put("org.springframework.data.hadoop.jar.other.args", args); System.getProperties().put("org.springframework.data.hadoop.jar.other.cfg", cfg); }
From source file:ArrayListComboBoxModel.java
public static void main(String args[]) { JFrame frame = new JFrame("ArrayListComboBoxModel"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Collection col = System.getProperties().values(); ArrayList arrayList = new ArrayList(col); ArrayListComboBoxModel model = new ArrayListComboBoxModel(arrayList); JComboBox comboBox = new JComboBox(model); Container contentPane = frame.getContentPane(); contentPane.add(comboBox, BorderLayout.NORTH); frame.setSize(300, 225);/*from ww w. j av a 2 s .co m*/ frame.setVisible(true); }
From source file:SystemInfo.java
public static void main(String args[]) { try {/* w w w.j av a 2s . c o m*/ Properties sysprops = System.getProperties(); sysprops.store(System.out, "System Properties"); } catch (IOException e) { e.printStackTrace(); } }
From source file:TreeNodeVector.java
public static void main(final String args[]) { JFrame frame = new JFrame("JTreeSample"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Vector<String> v1 = new TreeNodeVector<String>("Two", new String[] { "Mercury", "Venus", "Mars" }); Vector<Object> v2 = new TreeNodeVector<Object>("Three"); v2.add(System.getProperties()); v2.add(v1);/*from w w w.ja va 2 s. c om*/ Object rootNodes[] = { v1, v2 }; Vector<Object> rootVector = new TreeNodeVector<Object>("Root", rootNodes); JTree tree = new JTree(rootVector); DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree.getCellRenderer(); Color backgroundSelection = renderer.getBackgroundSelectionColor(); renderer.setBackgroundSelectionColor(renderer.getBackgroundNonSelectionColor()); renderer.setBackgroundNonSelectionColor(backgroundSelection); Color textSelection = renderer.getTextSelectionColor(); renderer.setTextSelectionColor(renderer.getTextNonSelectionColor()); renderer.setTextNonSelectionColor(textSelection); frame.add(new JScrollPane(tree), BorderLayout.CENTER); frame.setSize(300, 300); frame.setVisible(true); }
From source file:TreeNodeVector.java
public static void main(final String args[]) { UIManager.put("Tree.openIcon", new ImageIcon("yourFile.gif")); JFrame frame = new JFrame("JTreeSample"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Vector<String> v1 = new TreeNodeVector<String>("Two", new String[] { "Mercury", "Venus", "Mars" }); Vector<Object> v2 = new TreeNodeVector<Object>("Three"); v2.add(System.getProperties()); v2.add(v1);/* ww w. ja va 2 s . c om*/ Object rootNodes[] = { v1, v2 }; Vector<Object> rootVector = new TreeNodeVector<Object>("Root", rootNodes); JTree tree = new JTree(rootVector); frame.add(new JScrollPane(tree), BorderLayout.CENTER); frame.setSize(300, 300); frame.setVisible(true); }
From source file:com.sigma.drive.Wordcount.java
public static void main(String[] args) throws Exception { File workaround = new File("."); System.getProperties().put("hadoop.home.dir", workaround.getAbsolutePath()); new File("./bin").mkdirs(); new File("./bin/winutils.exe").createNewFile(); AbstractApplicationContext context = new ClassPathXmlApplicationContext("/spring.xml", Wordcount.class); log.info("Wordcount with HDFS copy Application Running"); context.registerShutdownHook();//from w ww . j a v a 2s . c om }
From source file:SendMail.java
public static void main(String[] args) { try {/*from ww w .j ava 2s. c o m*/ // If the user specified a mailhost, tell the system about it. if (args.length >= 1) System.getProperties().put("mail.host", args[0]); // A Reader stream to read from the console BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); // Ask the user for the from, to, and subject lines System.out.print("From: "); String from = in.readLine(); System.out.print("To: "); String to = in.readLine(); System.out.print("Subject: "); String subject = in.readLine(); // Establish a network connection for sending mail URL u = new URL("mailto:" + to); // Create a mailto: URL URLConnection c = u.openConnection(); // Create its URLConnection c.setDoInput(false); // Specify no input from it c.setDoOutput(true); // Specify we'll do output System.out.println("Connecting..."); // Tell the user System.out.flush(); // Tell them right now c.connect(); // Connect to mail host PrintWriter out = // Get output stream to host new PrintWriter(new OutputStreamWriter(c.getOutputStream())); // We're talking to the SMTP server now. // Write out mail headers. Don't let users fake the From address out.print("From: \"" + from + "\" <" + System.getProperty("user.name") + "@" + InetAddress.getLocalHost().getHostName() + ">\r\n"); out.print("To: " + to + "\r\n"); out.print("Subject: " + subject + "\r\n"); out.print("\r\n"); // blank line to end the list of headers // Now ask the user to enter the body of the message System.out.println("Enter the message. " + "End with a '.' on a line by itself."); // Read message line by line and send it out. String line; for (;;) { line = in.readLine(); if ((line == null) || line.equals(".")) break; out.print(line + "\r\n"); } // Close (and flush) the stream to terminate the message out.close(); // Tell the user it was successfully sent. System.out.println("Message sent."); } catch (Exception e) { // Handle any exceptions, print error message. System.err.println(e); System.err.println("Usage: java SendMail [<mailhost>]"); } }
From source file:com.fizzed.stork.test.HelloMain.java
static public void main(String[] args) throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.INDENT_OUTPUT, true); HelloOutput output = new HelloOutput(); output.setConfirm("Hello World!"); output.setEnvironment(System.getenv()); output.setSystemProperties(System.getProperties()); output.setArguments(Arrays.asList(args)); mapper.writeValue(System.out, output); }
From source file:test.SomeMainClass.java
public static void main(String[] args) throws Exception { Configuration cfg = new Configuration(); cfg.size();/*from w ww.j a va 2 s . c om*/ System.out.println("*** New Config is ***" + dumpConfiguration(cfg).toString()); System.getProperties().put("org.springframework.data.hadoop.jar.cfg", cfg); System.getProperties().put("org.springframework.data.hadoop.jar.args", args); System.setProperty("org.springframework.data.jar.exit.pre", "true"); try { System.exit(1); } catch (Throwable th) { System.getProperties().put("org.springframework.data.jar.exit.exception", th); } }