if (e.getSource() == titlePane && e.getClickCount() == 2) try { if (frame.isMaximizable() && ! frame.isMaximum()) frame.setMaximum(true); else if (frame.isMaximum()) frame.setMaximum(false); } catch (PropertyVetoException pve) {  }
    public void mouseClicked(MouseEvent e)    {      // There is nothing to do when the mouse is clicked      // on the border.    }