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

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