/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package okaybox2; import javax.swing.JOptionPane; import java.awt.EventQueue; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Brian Fristensky */ public class OkayBox2 { /** * @param args the command line arguments */ public static void main(final String[] args) throws Exception { try { /** MacOSX - Swing components such as the FileChooser sometimes * don't popup on the screen. To fix this, the code * has to be wrapped in a Runnable through EventQueue. * see http://stackoverflow.com/questions/33599014/jfilechooser-not-showing */ EventQueue.invokeAndWait(new Runnable() { @Override public void run() { JOptionPane ob = new JOptionPane (); String title; String message; if (args.length >= 1) { message = args[0]; } else { message = " "; } if (args.length >= 2) { title = args[1]; } else { title = "Notification"; } ob.showConfirmDialog(null,message,title,JOptionPane.DEFAULT_OPTION,JOptionPane.PLAIN_MESSAGE); } }); } catch (Exception ex) { Logger.getLogger(OkayBox2.class.getName()).log(Level.SEVERE, null, ex); } // TODO code application logic here } }