Refine search
encodingPanel.add(textPanel); encodingPanel.add(Box.createVerticalStrut(5)); final JOptionPane fileFilterDialog = new JOptionPane(); fileFilterDialog.setMessage(encodingPanel); JButton[] options = new JButton[3]; final JDialog dialog = fileFilterDialog.createDialog(null, "Default encoding changed..."); useNewEncoding.addActionListener(arg0 -> { FileTreeModel.setCurEncoding(encoding); System.out.println("encoding null!!"); setEncoding.setText(encoding); dialog.setVisible(false); }); useOldEncoding.addActionListener(e -> dialog.setVisible(false)); useAnotherEncoding.addActionListener(e -> { dialog.setVisible(false); alternateEncodingPrompt(encoding); });
private void showProgressPanel(List<ComponentDescription> comps, boolean install) { final ProgressPanel pp = new ProgressPanel(comps, install); final JOptionPane optionPane = new JOptionPane(pp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new String[] { "Abort" }, "Abort"); // optionPane.setPreferredSize(new Dimension(640,480)); final JDialog dialog = new JDialog((Frame) null, "Progress", false); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { pp.requestExit(); dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); new Thread(pp).start(); }
public SwingDialogPrompt(final String message, final String title, final MessageType messageType, final OptionType optionType) { pane = new JOptionPane(message, msgMap.get(messageType), optionMap .get(optionType)); // pane.set.Xxxx(...); // Configure dialog = pane.createDialog(null, title); }
final JOptionPane fileFilterDialog = new JOptionPane(); fileFilterDialog.setMessage(fileFilterPanel); JButton[] options = new JButton[3]; final JDialog dialog = fileFilterDialog.createDialog(null, "Set file filters..."); okay.addActionListener(arg0 -> { dialog.setVisible(false); startFileLoadingThread(filters, cFiles); }); dialog.pack(); }); cancel.addActionListener(e -> dialog.setVisible(false)); dialog.getRootPane().setDefaultButton(okay); dialog.pack(); dialog.setLocationRelativeTo(this); dialog.setVisible(true);
private void showProgressPanel(List<ComponentDescription> comps, boolean install) { final ProgressPanel pp = new ProgressPanel(comps, install); final JOptionPane optionPane = new JOptionPane(pp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new String[] { "Abort" }, "Abort"); // optionPane.setPreferredSize(new Dimension(640,480)); final JDialog dialog = new JDialog((Frame) null, "Progress", false); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { pp.requestExit(); dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); new Thread(pp).start(); }
public SwingDialogPrompt(final String message, final String title, final MessageType messageType, final OptionType optionType) { pane = new JOptionPane(message, msgMap.get(messageType), optionMap .get(optionType)); // pane.set.Xxxx(...); // Configure dialog = pane.createDialog(null, title); // dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); }
JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField))); JDialog dialog = pane.createDialog(null, title); pane.selectInitialValue(); dialog.setVisible(true); dialog.dispose();
private void miProxy1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_miProxy1ActionPerformed ProxyPanel prp = new ProxyPanel(System.getProperty("http.proxyHost"), System.getProperty("http.proxyPort")); final JOptionPane optionPane = new JOptionPane(prp, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION, null, new String[] { "OK", "Cancel" }, "OK"); final JDialog dialog = new JDialog((Frame) null, "", true); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); if ("OK".equals(optionPane.getValue())) { System.setProperty("http.proxyHost", prp.getProxyHost()); System.setProperty("http.proxyPort", prp.getProxyPort()); } }// GEN-LAST:event_miProxy1ActionPerformed
import javax.swing.JDialog; import javax.swing.JOptionPane; public class TheComboBoxes { public static void main(String[] args) { JOptionPane optionPane = new JOptionPane("The only way to close this dialog is by\n" + "pressing one of the following buttons.\n" + "Do you understand?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION); JDialog dialog = optionPane.createDialog("click"); dialog.setVisible(true); } }
JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField))); JDialog dialog = pane.createDialog(null, title); pane.selectInitialValue(); dialog.setVisible(true); dialog.dispose();
private void miProxy1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_miProxy1ActionPerformed ProxyPanel prp = new ProxyPanel(System.getProperty("http.proxyHost"), System.getProperty("http.proxyPort")); final JOptionPane optionPane = new JOptionPane(prp, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION, null, new String[] { "OK", "Cancel" }, "OK"); final JDialog dialog = new JDialog((Frame) null, "", true); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); if ("OK".equals(optionPane.getValue())) { System.setProperty("http.proxyHost", prp.getProxyHost()); System.setProperty("http.proxyPort", prp.getProxyPort()); } }// GEN-LAST:event_miProxy1ActionPerformed
JOptionPane pane = new JOptionPane("pane"); JDialog dialog = pane.createDialog(null, "Title"); dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); dialog.show();
JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField))); JDialog dialog = pane.createDialog(null, title); pane.selectInitialValue(); dialog.setVisible(true); dialog.dispose();
@Override protected PasswordAuthentication getPasswordAuthentication() { PasswordPanel passP = new PasswordPanel(); final JOptionPane optionPane = new JOptionPane(passP, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new String[] { "OK", "Cancel" }, "OK"); final JDialog dialog = new JDialog((Frame) null, "", true); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); if ("OK".equals(optionPane.getValue())) { return new PasswordAuthentication(passP.getUser(), passP.getPassword()); } return null; } });
JOptionPane pane = new JOptionPane("message"); JDialog dialog = pane.createDialog(null, "Title"); dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); dialog.show();
JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField))); JDialog dialog = pane.createDialog(null, title); pane.selectInitialValue(); dialog.setVisible(true); dialog.dispose();
System.out.println("Showing license " + licenseURL + " for " + comps.size() + " components"); LicensePanel licensePanel = new LicensePanel(localURL, comps); final JOptionPane optionPane = new JOptionPane(licensePanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION, null, new String[] { "Reject", "Accept" }, "Reject"); optionPane.setPreferredSize(new Dimension(800, 600)); dialog.setVisible(true);
public static String getPassword(String title) { JPanel panel = new JPanel(); final JPasswordField passwordField = new JPasswordField(10); panel.add(new JLabel("Password")); panel.add(passwordField); JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION) { @Override public void selectInitialValue() { passwordField.requestFocusInWindow(); } }; pane.createDialog(null, title).setVisible(true); return passwordField.getPassword().length == 0 ? null : new String(passwordField.getPassword()); }
JOptionPane optionPane = new JOptionPane(); JDialog dialog = optionPane.createDialog("Title"); dialog.setAlwaysOnTop(alwaysOnTop); dialog.setVisible(true);
System.out.println("Showing license " + licenseURL + " for " + comps.size() + " components"); LicensePanel licensePanel = new LicensePanel(localURL, comps); final JOptionPane optionPane = new JOptionPane(licensePanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION, null, new String[] { "Reject", "Accept" }, "Reject"); optionPane.setPreferredSize(new Dimension(800, 600)); dialog.setVisible(true);