< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java

Print this page




 243 
 244         public void mouseClicked(MouseEvent e) {
 245             if (e.getClickCount() == 2 && e.getSource() == getNorthPane() &&
 246                 frame.isClosable() && !frame.isIcon()) {
 247                 Rectangle rect = getIconBounds();
 248                 if ((rect != null) && rect.contains(e.getX(), e.getY())) {
 249                     frame.doDefaultCloseAction();
 250                 }
 251                 else {
 252                     super.mouseClicked(e);
 253                 }
 254             }
 255             else {
 256                 super.mouseClicked(e);
 257             }
 258         }
 259     };    /// End BorderListener Class
 260 
 261 
 262     /**
 263      * Returns the <code>MouseInputAdapter</code> that will be installed
 264      * on the TitlePane.
 265      *
 266      * @param w the <code>JInternalFrame</code>
 267      * @return the <code>MouseInputAdapter</code> that will be installed
 268      * on the TitlePane.
 269      * @since 1.6
 270      */
 271     protected MouseInputAdapter createBorderListener(JInternalFrame w) {
 272         return new BorderListener1();
 273     }
 274 }


 243 
 244         public void mouseClicked(MouseEvent e) {
 245             if (e.getClickCount() == 2 && e.getSource() == getNorthPane() &&
 246                 frame.isClosable() && !frame.isIcon()) {
 247                 Rectangle rect = getIconBounds();
 248                 if ((rect != null) && rect.contains(e.getX(), e.getY())) {
 249                     frame.doDefaultCloseAction();
 250                 }
 251                 else {
 252                     super.mouseClicked(e);
 253                 }
 254             }
 255             else {
 256                 super.mouseClicked(e);
 257             }
 258         }
 259     };    /// End BorderListener Class
 260 
 261 
 262     /**
 263      * Returns the {@code MouseInputAdapter} that will be installed
 264      * on the TitlePane.
 265      *
 266      * @param w the {@code JInternalFrame}
 267      * @return the {@code MouseInputAdapter} that will be installed
 268      * on the TitlePane.
 269      * @since 1.6
 270      */
 271     protected MouseInputAdapter createBorderListener(JInternalFrame w) {
 272         return new BorderListener1();
 273     }
 274 }
< prev index next >