839 * to create modal dialogs with the given <code>modalityType</code>
840 *
841 * @see java.awt.Dialog#getModalityType
842 * @see java.awt.Toolkit#isModalityTypeSupported
843 *
844 * @since 1.6
845 */
846 public void setModalityType(ModalityType type) {
847 if (type == null) {
848 type = Dialog.ModalityType.MODELESS;
849 }
850 if (!Toolkit.getDefaultToolkit().isModalityTypeSupported(type)) {
851 type = Dialog.ModalityType.MODELESS;
852 }
853 if (modalityType == type) {
854 return;
855 }
856 if (type == ModalityType.TOOLKIT_MODAL) {
857 SecurityManager sm = System.getSecurityManager();
858 if (sm != null) {
859 sm.checkPermission(SecurityConstants.TOOLKIT_MODALITY_PERMISSION);
860 }
861 }
862 modalityType = type;
863 modal = (modalityType != ModalityType.MODELESS);
864 }
865
866 /**
867 * Gets the title of the dialog. The title is displayed in the
868 * dialog's border.
869 * @return the title of this dialog window. The title may be
870 * <code>null</code>.
871 * @see java.awt.Dialog#setTitle
872 */
873 public String getTitle() {
874 return title;
875 }
876
877 /**
878 * Sets the title of the Dialog.
879 * @param title the title displayed in the dialog's border;
|
839 * to create modal dialogs with the given <code>modalityType</code>
840 *
841 * @see java.awt.Dialog#getModalityType
842 * @see java.awt.Toolkit#isModalityTypeSupported
843 *
844 * @since 1.6
845 */
846 public void setModalityType(ModalityType type) {
847 if (type == null) {
848 type = Dialog.ModalityType.MODELESS;
849 }
850 if (!Toolkit.getDefaultToolkit().isModalityTypeSupported(type)) {
851 type = Dialog.ModalityType.MODELESS;
852 }
853 if (modalityType == type) {
854 return;
855 }
856 if (type == ModalityType.TOOLKIT_MODAL) {
857 SecurityManager sm = System.getSecurityManager();
858 if (sm != null) {
859 sm.checkPermission(SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION);
860 }
861 }
862 modalityType = type;
863 modal = (modalityType != ModalityType.MODELESS);
864 }
865
866 /**
867 * Gets the title of the dialog. The title is displayed in the
868 * dialog's border.
869 * @return the title of this dialog window. The title may be
870 * <code>null</code>.
871 * @see java.awt.Dialog#setTitle
872 */
873 public String getTitle() {
874 return title;
875 }
876
877 /**
878 * Sets the title of the Dialog.
879 * @param title the title displayed in the dialog's border;
|