本文整理匯總了Java中javax.swing.JDialog.DEFAULT_MODALITY_TYPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java JDialog.DEFAULT_MODALITY_TYPE屬性的具體用法?Java JDialog.DEFAULT_MODALITY_TYPE怎麽用?Java JDialog.DEFAULT_MODALITY_TYPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.swing.JDialog
的用法示例。
在下文中一共展示了JDialog.DEFAULT_MODALITY_TYPE屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: GUI_About
/**
* Creates a new, initially invisible <code>Frame</code> with the
* specified title.
* <p>
* This constructor sets the component's locale property to the value
* returned by <code>JComponent.getDefaultLocale</code>.
*
* @param title the title for the frame
* @param relativeTo relative to which parent component
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true.
* @see GraphicsEnvironment#isHeadless
* @see Component#setSize
* @see Component#setVisible
* @see JComponent#getDefaultLocale
*/
public GUI_About(@NotNull String title, @Nullable JFrame relativeTo) throws HeadlessException {
super(relativeTo, title, JDialog.DEFAULT_MODALITY_TYPE);
this.parent = relativeTo;
this.imagePanel = this.aboutIcon();
this.setVisible(false);
this.createCloseButton();
this.constructAbout();
this.windowCloseOperation();
this.setLocationRelativeTo(this.parent);
}