package dialog; import javax.swing.JOptionPane; public class MessageDialogs { public static String showYesNoDialog(String A_strMessage) { String strRetVal = new String(""); Object[] options = {"Yes", "No"}; int nRetVal = JOptionPane.showOptionDialog( null, A_strMessage, "Question", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); if(nRetVal == 1) strRetVal = "yes"; else if (nRetVal == 0) strRetVal = "no"; return strRetVal; } public static void showInformation(String A_strMessage){ JOptionPane.showMessageDialog(null, A_strMessage); } }