private static void createAndShowGUI(boolean showUI){
  JFrame frame=new JFrame("FileChooserDemo");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.add(new FileChooser(null));
  frame.pack();
  frame.setVisible(showUI);
}

private static void createAndShowGUI ( boolean showUI ) { JFrame frame = new JFrame ( "FileChooserDemo" ) ; frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; frame . add ( new FileChooser ( null ) ) ; frame . pack ( ) ; frame . setVisible ( showUI ) ; }
create the gui and show it . for thread safety , this method should be invoked from the event dispatch thread .
