Skip to content

Instantly share code, notes, and snippets.

@zubairov
Created June 19, 2010 22:15
Show Gist options
  • Save zubairov/445332 to your computer and use it in GitHub Desktop.
Save zubairov/445332 to your computer and use it in GitHub Desktop.
   private void createAndShowGUI() {
       //Create and set up the window.
       appFrame = new JFrame(Messages.CarRentalClient_Title);
       appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       // Display the window centered on the screen
       Dimension d = appFrame.getToolkit().getScreenSize();
       appFrame.setLocation((d.width / 2) - (appFrame.getWidth() / 2), (appFrame.getHeight() / 2));
       main = createPanel();
       appFrame.getContentPane().add(main);
       main.add(createHeaderPanel(), BorderLayout.NORTH);
       findPanel = createFindPanel();
       selectPanel = createSelectionPanel();
       main.add(findPanel, BorderLayout.CENTER);
       appFrame.pack();
       appFrame.setVisible(true);
       appFrame.toFront();
   }
   public void openApp() {
       javax.swing.SwingUtilities.invokeLater(new Runnable() {
           public void run() {
               createAndShowGUI();
           }
       });
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment