private static void createAndShowGUI(){
  JFrame frame=new JFrame("GridBagLayoutDemo");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  addComponentsToPane(frame.getContentPane());
  frame.pack();
  frame.setVisible(true);
}

private static void createAndShowGUI ( ) { JFrame frame = new JFrame ( "GridBagLayoutDemo" ) ; frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; addComponentsToPane ( frame . getContentPane ( ) ) ; frame . pack ( ) ; frame . setVisible ( true ) ; }
create the gui and show it . for thread safety , this method should be invoked from the event - dispatching thread .
