< prev index next >

src/java.desktop/share/classes/javax/swing/Popup.java

Print this page




 236             setType(Window.Type.POPUP);
 237 
 238             // Popups are typically transient and most likely won't benefit
 239             // from true double buffering.  Turn it off here.
 240             getRootPane().setUseTrueDoubleBuffering(false);
 241             // Try to set "always-on-top" for the popup window.
 242             // Applets usually don't have sufficient permissions to do it.
 243             // In this case simply ignore the exception.
 244             try {
 245                 setAlwaysOnTop(true);
 246             } catch (SecurityException se) {
 247                 // setAlwaysOnTop is restricted,
 248                 // the exception is ignored
 249             }
 250         }
 251 
 252         public void update(Graphics g) {
 253             paint(g);
 254         }
 255 

 256         public void show() {
 257             this.pack();
 258             if (getWidth() > 0 && getHeight() > 0) {
 259                 super.show();
 260             }
 261         }
 262     }
 263 
 264 
 265     /**
 266      * Used if no valid Window ancestor of the supplied owner is found.
 267      * <p>
 268      * PopupFactory uses this as a way to know when the Popup shouldn't
 269      * be cached based on the Window.
 270      */
 271     @SuppressWarnings("serial") // JDK-implementation class
 272     static class DefaultFrame extends Frame {
 273     }
 274 }


 236             setType(Window.Type.POPUP);
 237 
 238             // Popups are typically transient and most likely won't benefit
 239             // from true double buffering.  Turn it off here.
 240             getRootPane().setUseTrueDoubleBuffering(false);
 241             // Try to set "always-on-top" for the popup window.
 242             // Applets usually don't have sufficient permissions to do it.
 243             // In this case simply ignore the exception.
 244             try {
 245                 setAlwaysOnTop(true);
 246             } catch (SecurityException se) {
 247                 // setAlwaysOnTop is restricted,
 248                 // the exception is ignored
 249             }
 250         }
 251 
 252         public void update(Graphics g) {
 253             paint(g);
 254         }
 255 
 256         @SuppressWarnings("deprecation")
 257         public void show() {
 258             this.pack();
 259             if (getWidth() > 0 && getHeight() > 0) {
 260                 super.show();
 261             }
 262         }
 263     }
 264 
 265 
 266     /**
 267      * Used if no valid Window ancestor of the supplied owner is found.
 268      * <p>
 269      * PopupFactory uses this as a way to know when the Popup shouldn't
 270      * be cached based on the Window.
 271      */
 272     @SuppressWarnings("serial") // JDK-implementation class
 273     static class DefaultFrame extends Frame {
 274     }
 275 }
< prev index next >