private static void displayPopup() { optionPane.setDetailsVisible(true); JDialog dialog = optionPane.createDialog(MapTool.getFrame(), I18N.getString("MapToolEventQueue.warning.title")); //$NON-NLS-1$ dialog.setResizable(true); dialog.pack(); dialog.setVisible(true); }
/** * 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); }
JButton reportButton = new JButton("Report Issue"); ((JComponent)optionPane.getComponent(optionPane.getComponentCount()-1)).add(reportButton); final JDialog dialog = optionPane.createDialog(getMainWindow(), "Error encountered"); dialog.setResizable(true); String details = t.getMessage() + "\r\n" + MiscUtils.getStackTrace(t);
((JComponent) optionPane.getComponent(optionPane.getComponentCount()-1)).add(reportButton); final JDialog dialog = optionPane.createDialog(KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(), title); cancelButton.addActionListener(new ActionListener() { @Override
JButton reportButton = new JButton("Report Issue"); ((JComponent)optionPane.getComponent(optionPane.getComponentCount() - 1)).add(reportButton); final JDialog dialog = optionPane.createDialog(DialogUtils.getMainWindow(), "Format Unsuccessful"); dialog.setModal(true); dialog.setResizable(true);
JDialog dialog = pane.createDialog(parentComponent, title, style);
JDialog dialog = pane.createDialog(parentComponent, title, style);