List of utility methods to do JOptionPane Message
int | display2(Component parent, String message, String title, int optionType, int messageType, Icon icon) display return JOptionPane.showConfirmDialog(parent, message, title, optionType, messageType, icon);
|
String | displayEditor(Component parent, String title, String msg) display Editor JTextArea editArea = new JTextArea(msg, 5, 30); editArea.setEditable(true); editArea.setLineWrap(true); JScrollPane scroll = new JScrollPane(editArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); final JOptionPane optionPane = new JOptionPane(scroll, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); JDialog dialog = optionPane.createDialog(parent, title); ... |
String | displayInputMessage(String title, String message, String defaultInput) display Input Message String result = JOptionPane.showInputDialog(getFrontWindow(), message, title, JOptionPane.QUESTION_MESSAGE); if (result != null && result.length() > 0) { return result; return null; |
String | displayInputMessage(String title, String message, String defaultInput) Display a dialog that gets an input string from the user. String result = JOptionPane.showInputDialog(getMainWindow(), message, "Savant", JOptionPane.QUESTION_MESSAGE); if (result != null && result.length() > 0) { return result; return null; |
void | displayMessage(Component parent, String string, String title) display Message JOptionPane.showMessageDialog(parent, string, title, JOptionPane.INFORMATION_MESSAGE); |
void | displayMessage(Component parentComponent, String message, String windowTitle, int messageType) display Message JOptionPane p = new JOptionPane(message, messageType) { public int getMaxCharactersPerLineCount() { return 72; }; p.setMessage(message); JDialog dialog = p.createDialog(parentComponent, windowTitle); dialog.setVisible(true); ... |
void | displayMessage(String message) Display a Savant message dialog with the given message and the title "MedSavant". displayMessage("MedSavant", message);
|
void | displayMessagePane(String desc, String title) This function displays the JOptionPane with title and descritpion if (title == null) title = "Message Dialog"; JOptionPane.showMessageDialog(null, desc, title, JOptionPane.PLAIN_MESSAGE); |
void | excMsg(String msg, Exception ex) Exception message dialog. final String fullMsg = msg += LS + "Exception: " + ex + LS + ex.getMessage(); SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, fullMsg, "Error", JOptionPane.ERROR_MESSAGE); System.out.println(fullMsg); }); |
void | excMsg(String msg, Exception ex) Exception message dialog. final String fullMsg = msg += LS + "Exception: " + ex + LS + ex.getMessage(); SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, fullMsg, "Error", JOptionPane.ERROR_MESSAGE); System.out.println(fullMsg); }); |