List of utility methods to do JOptionPane Message
void | showMessage(String msg) show Message showMessage(new String[] { msg });
|
void | showMessage(String title, String message) Display a sample message in a dialog box. JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE); |
void | showMessage(String title, String message, java.awt.Component parent) show Message JOptionPane.showMessageDialog(parent, splitIntoLines(message), title, JOptionPane.INFORMATION_MESSAGE); |
void | showMessageInEventQueue(final String message, final String title) show Message In Event Queue EventQueue.invokeLater(new Runnable() { public void run() { showMessage(message, title); }); |
void | showMessages(Component parent, List show Messages if ((messages == null) || (messages.size() == 0)) { return; Window window = SwingUtilities.windowForComponent(parent); StringBuilder sb = new StringBuilder(); if (messages != null) { for (int i = 0, size = messages.size(); i < size; i++) { sb.append(messages.get(i)); ... |
void | showMsg(final Container parent, final String message) show Msg SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parent, message, UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.INFORMATION_MESSAGE); }); |
boolean | ShowOkCancelMessage(String msg) Show Ok Cancel Message int result = JOptionPane.showConfirmDialog(null, msg, "Confirmation dialog", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.YES_OPTION) return true; else return false; |
void | ShowOkMessage(String msg) Show Ok Message JOptionPane.showMessageDialog(null, msg); |
int | showPrettyYesNoPane(Component caller, String msg, String title) show Pretty Yes No Pane Object[] options = { "Yes", "No" }; return JOptionPane.showOptionDialog(caller, "<html><body><p style='width: 200px;'>" + msg + "</p></body></html>", title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); |
int | showQuestionThreeChoicesBox(Component pParent, String pMessage, String pTitle, String pLeftOption, String pMiddleOption, String pRightOption) Results: YES_OPTION = Middle NO_OPTION = Left CANCEL_OPTION = Right UIManager.put("OptionPane.noButtonText", pLeftOption); UIManager.put("OptionPane.yesButtonText", pMiddleOption); UIManager.put("OptionPane.cancelButtonText", pRightOption); int result = JOptionPane.showConfirmDialog(pParent, pMessage, pTitle, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); UIManager.put("OptionPane.noButtonText", "No"); UIManager.put("OptionPane.yesButtonText", "Yes"); UIManager.put("OptionPane.cancelButtonText", "Cancel"); ... |