code: private static void createAndShowGUI() {
  
      // Create and set up the window.
      JFrame frame = new JFrame("PCB Annotated Image Explorer");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      // Add content to the window.
      frame.add(new PCBAnnotatedImageViewer());
  
      Runtime.getRuntime().addShutdownHook(new Thread() {
  
        @Override
        public void run() {
  
          System.out.println("****************************");
          PCBDAO.release(); // release data resources
  
        }
      });
      // Display the window.
      frame.pack();
      frame.setVisible(true);
    }
docs: Create the GUI and show it. For thread safety, this method should be invoked from the event dispatch thread.