/** * Creates and returns a new parentless <code>JDialog</code> with the specified title. The returned * <code>JDialog</code> will not be resizable by the user, however programs can invoke <code>setResizable</code> on * the <code>JDialog</code> instance to change this property. The returned <code>JDialog</code> will be set up such * that once it is closed, or the user clicks on one of the buttons, the optionpane's value property will be set * accordingly and the dialog will be closed. Each time the dialog is made visible, it will reset the option pane's * value property to <code>JOptionPane.UNINITIALIZED_VALUE</code> to ensure the user's subsequent action closes the * dialog properly. * * @param title the title string for the dialog * * @return a new <code>JDialog</code> containing this instance * * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.6 */ public JDialog createDialog(String title) throws HeadlessException { int style = styleFromMessageType(getMessageType()); JDialog dialog = new JDialog((Dialog) null, title, true); initDialog(dialog, style, null); return dialog; }
/** * Creates and returns a new <code>JDialog</code> wrapping <code>this</code> centered on the * <code>parentComponent</code> in the <code>parentComponent</code>'s frame. <code>title</code> is the title of the * returned dialog. The returned <code>JDialog</code> will not be resizable by the user, however programs can invoke * <code>setResizable</code> on the <code>JDialog</code> instance to change this property. The returned * <code>JDialog</code> will be set up such that once it is closed, or the user clicks on one of the buttons, the * optionpane's value property will be set accordingly and the dialog will be closed. Each time the dialog is made * visible, it will reset the option pane's value property to <code>JOptionPane.UNINITIALIZED_VALUE</code> to ensure * the user's subsequent action closes the dialog properly. * * @param parentComponent determines the frame in which the dialog is displayed; if the <code>parentComponent</code> * has no <code>Frame</code>, a default <code>Frame</code> is used * @param title the title string for the dialog * * @return a new <code>JDialog</code> containing this instance * * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> * @see java.awt.GraphicsEnvironment#isHeadless */ public JDialog createDialog(Component parentComponent, String title) throws HeadlessException { int style = styleFromMessageType(getMessageType()); return createDialog(parentComponent, title, style); }
getRootFrame() : parentComponent).getComponentOrientation()); int style = styleFromMessageType(messageType); JDialog dialog = pane.createDialog(parentComponent, title, style);
getRootFrame() : parentComponent).getComponentOrientation()); int style = styleFromMessageType(messageType); JDialog dialog = pane.createDialog(parentComponent, title, style);