< prev index next >

src/share/classes/javax/swing/JDialog.java

Print this page
rev 1527 : 6727662: Code improvement and warnings removing from swing packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: malenkov


 254      *     title bar
 255      * @param modal specifies whether dialog blocks user input to other top-level
 256      *     windows when shown. If <code>true</code>, the modality type property is set to
 257      *     <code>DEFAULT_MODALITY_TYPE</code> otherwise the dialog is modeless
 258      * @exception HeadlessException if <code>GraphicsEnvironment.isHeadless()</code>
 259      *     returns <code>true</code>.
 260      *
 261      * @see java.awt.Dialog.ModalityType
 262      * @see java.awt.Dialog.ModalityType#MODELESS
 263      * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE
 264      * @see java.awt.Dialog#setModal
 265      * @see java.awt.Dialog#setModalityType
 266      * @see java.awt.GraphicsEnvironment#isHeadless
 267      * @see JComponent#getDefaultLocale
 268      */
 269     public JDialog(Frame owner, String title, boolean modal) {
 270         super(owner == null? SwingUtilities.getSharedOwnerFrame() : owner,
 271               title, modal);
 272         if (owner == null) {
 273             WindowListener ownerShutdownListener =
 274                 (WindowListener)SwingUtilities.getSharedOwnerFrameShutdownListener();
 275             addWindowListener(ownerShutdownListener);
 276         }
 277         dialogInit();
 278     }
 279 
 280     /**
 281      * Creates a dialog with the specified title,
 282      * owner <code>Frame</code>, modality and <code>GraphicsConfiguration</code>.
 283      * If <code>owner</code> is <code>null</code>,
 284      * a shared, hidden frame will be set as the owner of this dialog.
 285      * <p>
 286      * This constructor sets the component's locale property to the value
 287      * returned by <code>JComponent.getDefaultLocale</code>.
 288      * <p>
 289      * NOTE: Any popup components (<code>JComboBox</code>,
 290      * <code>JPopupMenu</code>, <code>JMenuBar</code>)
 291      * created within a modal dialog will be forced to be lightweight.
 292      * <p>
 293      * NOTE: This constructor does not allow you to create an unowned
 294      * <code>JDialog</code>. To create an unowned <code>JDialog</code>


 306      *     of the target screen device.  If <code>gc</code> is
 307      *     <code>null</code>, the same
 308      *     <code>GraphicsConfiguration</code> as the owning Frame is used.
 309      * @exception HeadlessException if <code>GraphicsEnvironment.isHeadless()</code>
 310      *     returns <code>true</code>.
 311      * @see java.awt.Dialog.ModalityType
 312      * @see java.awt.Dialog.ModalityType#MODELESS
 313      * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE
 314      * @see java.awt.Dialog#setModal
 315      * @see java.awt.Dialog#setModalityType
 316      * @see java.awt.GraphicsEnvironment#isHeadless
 317      * @see JComponent#getDefaultLocale
 318      * @since 1.4
 319      */
 320     public JDialog(Frame owner, String title, boolean modal,
 321                    GraphicsConfiguration gc) {
 322         super(owner == null? SwingUtilities.getSharedOwnerFrame() : owner,
 323               title, modal, gc);
 324         if (owner == null) {
 325             WindowListener ownerShutdownListener =
 326                 (WindowListener)SwingUtilities.getSharedOwnerFrameShutdownListener();
 327             addWindowListener(ownerShutdownListener);
 328         }
 329         dialogInit();
 330     }
 331 
 332     /**
 333      * Creates a modeless dialog without a title with the
 334      * specified <code>Dialog</code> as its owner.
 335      * <p>
 336      * This constructor sets the component's locale property to the value
 337      * returned by <code>JComponent.getDefaultLocale</code>.
 338      *
 339      * @param owner the owner <code>Dialog</code> from which the dialog is displayed
 340      *     or <code>null</code> if this dialog has no owner
 341      * @exception HeadlessException <code>if GraphicsEnvironment.isHeadless()</code>
 342      *     returns <code>true</code>.
 343      * @see java.awt.GraphicsEnvironment#isHeadless
 344      * @see JComponent#getDefaultLocale
 345      */
 346     public JDialog(Dialog owner) {




 254      *     title bar
 255      * @param modal specifies whether dialog blocks user input to other top-level
 256      *     windows when shown. If <code>true</code>, the modality type property is set to
 257      *     <code>DEFAULT_MODALITY_TYPE</code> otherwise the dialog is modeless
 258      * @exception HeadlessException if <code>GraphicsEnvironment.isHeadless()</code>
 259      *     returns <code>true</code>.
 260      *
 261      * @see java.awt.Dialog.ModalityType
 262      * @see java.awt.Dialog.ModalityType#MODELESS
 263      * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE
 264      * @see java.awt.Dialog#setModal
 265      * @see java.awt.Dialog#setModalityType
 266      * @see java.awt.GraphicsEnvironment#isHeadless
 267      * @see JComponent#getDefaultLocale
 268      */
 269     public JDialog(Frame owner, String title, boolean modal) {
 270         super(owner == null? SwingUtilities.getSharedOwnerFrame() : owner,
 271               title, modal);
 272         if (owner == null) {
 273             WindowListener ownerShutdownListener =
 274                     SwingUtilities.getSharedOwnerFrameShutdownListener();
 275             addWindowListener(ownerShutdownListener);
 276         }
 277         dialogInit();
 278     }
 279 
 280     /**
 281      * Creates a dialog with the specified title,
 282      * owner <code>Frame</code>, modality and <code>GraphicsConfiguration</code>.
 283      * If <code>owner</code> is <code>null</code>,
 284      * a shared, hidden frame will be set as the owner of this dialog.
 285      * <p>
 286      * This constructor sets the component's locale property to the value
 287      * returned by <code>JComponent.getDefaultLocale</code>.
 288      * <p>
 289      * NOTE: Any popup components (<code>JComboBox</code>,
 290      * <code>JPopupMenu</code>, <code>JMenuBar</code>)
 291      * created within a modal dialog will be forced to be lightweight.
 292      * <p>
 293      * NOTE: This constructor does not allow you to create an unowned
 294      * <code>JDialog</code>. To create an unowned <code>JDialog</code>


 306      *     of the target screen device.  If <code>gc</code> is
 307      *     <code>null</code>, the same
 308      *     <code>GraphicsConfiguration</code> as the owning Frame is used.
 309      * @exception HeadlessException if <code>GraphicsEnvironment.isHeadless()</code>
 310      *     returns <code>true</code>.
 311      * @see java.awt.Dialog.ModalityType
 312      * @see java.awt.Dialog.ModalityType#MODELESS
 313      * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE
 314      * @see java.awt.Dialog#setModal
 315      * @see java.awt.Dialog#setModalityType
 316      * @see java.awt.GraphicsEnvironment#isHeadless
 317      * @see JComponent#getDefaultLocale
 318      * @since 1.4
 319      */
 320     public JDialog(Frame owner, String title, boolean modal,
 321                    GraphicsConfiguration gc) {
 322         super(owner == null? SwingUtilities.getSharedOwnerFrame() : owner,
 323               title, modal, gc);
 324         if (owner == null) {
 325             WindowListener ownerShutdownListener =
 326                     SwingUtilities.getSharedOwnerFrameShutdownListener();
 327             addWindowListener(ownerShutdownListener);
 328         }
 329         dialogInit();
 330     }
 331 
 332     /**
 333      * Creates a modeless dialog without a title with the
 334      * specified <code>Dialog</code> as its owner.
 335      * <p>
 336      * This constructor sets the component's locale property to the value
 337      * returned by <code>JComponent.getDefaultLocale</code>.
 338      *
 339      * @param owner the owner <code>Dialog</code> from which the dialog is displayed
 340      *     or <code>null</code> if this dialog has no owner
 341      * @exception HeadlessException <code>if GraphicsEnvironment.isHeadless()</code>
 342      *     returns <code>true</code>.
 343      * @see java.awt.GraphicsEnvironment#isHeadless
 344      * @see JComponent#getDefaultLocale
 345      */
 346     public JDialog(Dialog owner) {


< prev index next >