List of utility methods to do JOptionPane Message
void | notImplemented(final String message) Popup a warning dialog displaying message. JOptionPane.showMessageDialog(null, message, "Not Implemented", JOptionPane.WARNING_MESSAGE);
|
boolean | noTo(String message) Displays a confirmation window asking a user a yes or no question. return !yesTo(message);
|
int | optionWindow(String message, String title, String[] options) This method will display an option dialog box to get an index value of a given array of options return JOptionPane.showOptionDialog(null, message, title, JOptionPane.DEFAULT_OPTION,
JOptionPane.QUESTION_MESSAGE, null, options, 0);
|
void | pause(final String msg) Pops up a message box, blocking the current thread. JOptionPane.showMessageDialog(null, msg, "VisBio", JOptionPane.PLAIN_MESSAGE);
|
boolean | plain(String title, Object message, JComponent parent) Muestra un dialogo de confirmacion. int option = JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); return JOptionPane.OK_OPTION == option; |
void | popup(Component parent, String message, String title) popup JOptionPane.showMessageDialog(parent, message, title, 1); |
void | popupMessage(String message) Popup a message dialog. JOptionPane.showMessageDialog(null, message, "Problem", JOptionPane.ERROR_MESSAGE);
|
void | popupMessage(String title, String message) Gives the user a popup message with no icon. popupMessage(title, message, JOptionPane.PLAIN_MESSAGE); |
float | promptForFloat(Component parentComponent, String message, String title, float oldValue) Utility function to prompt for new float value float result = oldValue; String newValue = promptForString(parentComponent, message, title, Float.toString(oldValue)); if (newValue != null) { try { result = Float.parseFloat(newValue); } catch (NumberFormatException e) { result = oldValue; return result; |
String | promptForString(Component parentComponent, String message, String title, String oldValue) Utility function to prompt for new string value String result = oldValue; String newValue = (String) JOptionPane.showInputDialog(parentComponent, message, title, JOptionPane.PLAIN_MESSAGE, null, null, oldValue); if (newValue != null) { result = newValue; return result; |