List of utility methods to do JOptionPane Confirmation
int | showConfirmDialog(String message) Shows a confirm dialog with "Yes", "No", and "Cancel" buttons. return JOptionPane.showConfirmDialog(frame, message);
|
boolean | showConfirmDialog(String title, String message) Convenience method to show a confirmation dialog. int n = JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); return (n == JOptionPane.OK_OPTION); |
int | showConfirmMessage(String message, Component component) show Confirm Message int confirm = JOptionPane.showConfirmDialog(component, message, "Konfirmasi", JOptionPane.YES_NO_OPTION); return confirm; |
int | showQuestionConfirmBox(Component pParent, String pMessage, String pTitle, String pLeftOption, String pRightOption) show Question Confirm Box UIManager.put("OptionPane.noButtonText", pLeftOption); UIManager.put("OptionPane.yesButtonText", pRightOption); int result = JOptionPane.showConfirmDialog(pParent, pMessage, pTitle, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); UIManager.put("OptionPane.noButtonText", "No"); UIManager.put("OptionPane.yesButtonText", "Yes"); return result; |
int | showReplaceExistingFileConfirmDialog(Component parentComponent, File file) show Replace Existing File Confirm Dialog return JOptionPane.showConfirmDialog(parentComponent, "Do you want to replace the existing file " + file + " ?", "Warning", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); |