String s = (String)JOptionPane.showInputDialog(this, "Search string:", "Notification", JOptionPane.QUESTION_MESSAGE, null, null, notifyCondition);
JPanel notifyPanel = new JPanel(new GridBagLayout()); int x = 0; int y = 0; notifyPanel.add(new JLabel("Search string:"), new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0)); JTextField notifyField = new JTextField(20); notifyField.setText(notifyCondition); notifyPanel.add(notifyField, new GridBagConstraints(x, y++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 0, 5, 0), 0, 0)); x = 0; JCheckBox stdErrorCB = new JCheckBox("Notify on Standard Error", notifyOnStandardError); notifyPanel.add(stdErrorCB, new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0)); int result = JOptionPane.showConfirmDialog(this, notifyPanel, "Notification", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.CANCEL_OPTION) return; String s = notifyField.getText();
  private void setNotifyMenuItem_actionPerformed() {    String s =       (String)JOptionPane.showInputDialog(this,                                          "Search string:",                                          "Notification",                                          JOptionPane.QUESTION_MESSAGE,                                          null, null, notifyCondition);    if (s == null || s.length() == 0)      notifyCondition = null;    else      notifyCondition = s;    setNotification();  }