      }      private static void createAndShowGUI() {          //Create and set up the window.         JFrame frame = new JFrame("Frame");         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);          //Set up content pane         addComponentsToPane(frame);          //add menu bar         JMenuBar menuBar = new JMenuBar();         JMenu menu = new JMenu("Menu");         menu.add(new JMenuItem("Do nothing"));         menuBar.add(menu);         frame.setJMenuBar(menuBar);          frame.pack();         frame.setVisible(true);     }      public static void main(String[] args) {         //Schedule a job for the event-dispatching thread:         //creating and showing this application's GUI.         javax.swing.SwingUtilities.invokeLater(new Runnable() {             public void run() {                 createAndShowGUI();             }         });     } 