src/java.desktop/share/classes/java/awt/Dialog.java

Print this page




 737             return base + nameCounter++;
 738         }
 739     }
 740 
 741     /**
 742      * Makes this Dialog displayable by connecting it to
 743      * a native screen resource.  Making a dialog displayable will
 744      * cause any of its children to be made displayable.
 745      * This method is called internally by the toolkit and should
 746      * not be called directly by programs.
 747      * @see Component#isDisplayable
 748      * @see #removeNotify
 749      */
 750     public void addNotify() {
 751         synchronized (getTreeLock()) {
 752             if (parent != null && parent.peer == null) {
 753                 parent.addNotify();
 754             }
 755 
 756             if (peer == null) {
 757                 peer = getToolkit().createDialog(this);
 758             }
 759             super.addNotify();
 760         }
 761     }
 762 
 763     /**
 764      * Indicates whether the dialog is modal.
 765      * <p>
 766      * This method is obsolete and is kept for backwards compatibility only.
 767      * Use {@link #getModalityType getModalityType()} instead.
 768      *
 769      * @return    <code>true</code> if this dialog window is modal;
 770      *            <code>false</code> otherwise
 771      *
 772      * @see       java.awt.Dialog#DEFAULT_MODALITY_TYPE
 773      * @see       java.awt.Dialog.ModalityType#MODELESS
 774      * @see       java.awt.Dialog#setModal
 775      * @see       java.awt.Dialog#getModalityType
 776      * @see       java.awt.Dialog#setModalityType
 777      */




 737             return base + nameCounter++;
 738         }
 739     }
 740 
 741     /**
 742      * Makes this Dialog displayable by connecting it to
 743      * a native screen resource.  Making a dialog displayable will
 744      * cause any of its children to be made displayable.
 745      * This method is called internally by the toolkit and should
 746      * not be called directly by programs.
 747      * @see Component#isDisplayable
 748      * @see #removeNotify
 749      */
 750     public void addNotify() {
 751         synchronized (getTreeLock()) {
 752             if (parent != null && parent.peer == null) {
 753                 parent.addNotify();
 754             }
 755 
 756             if (peer == null) {
 757                 peer = getComponentFactory().createDialog(this);
 758             }
 759             super.addNotify();
 760         }
 761     }
 762 
 763     /**
 764      * Indicates whether the dialog is modal.
 765      * <p>
 766      * This method is obsolete and is kept for backwards compatibility only.
 767      * Use {@link #getModalityType getModalityType()} instead.
 768      *
 769      * @return    <code>true</code> if this dialog window is modal;
 770      *            <code>false</code> otherwise
 771      *
 772      * @see       java.awt.Dialog#DEFAULT_MODALITY_TYPE
 773      * @see       java.awt.Dialog.ModalityType#MODELESS
 774      * @see       java.awt.Dialog#setModal
 775      * @see       java.awt.Dialog#getModalityType
 776      * @see       java.awt.Dialog#setModalityType
 777      */