コード例 #1
0
    /**
     * Repacks the window each time it is displayed to adjust size to fit wording and buttons.
     *
     * @param e event.
     */
    protected void processWindowEvent(WindowEvent e) {
      super.processWindowEvent(e);

      if (e.getID() == WindowEvent.WINDOW_OPENED) pack();
    }
コード例 #2
0
 public void windowClosing(WindowEvent evt) {
   JFrame frame = (JFrame) evt.getSource();
   frame.setVisible(false);
   frame.dispose();
 }