Here you can find the source of askSave(JFrame frame)
public static int askSave(JFrame frame)
//package com.java2s; //License from project: Open Source License import javax.swing.JFrame; import javax.swing.JOptionPane; public class Main { public static final String SAVE_QUESTION_TITLE = "Really save?"; public static final String SAVE_QUESTION_MESSAGE = "Do you really want to save this information?\n" + "(The current file will be backed up)"; public static int askSave(JFrame frame) { return JOptionPane.showOptionDialog(frame, SAVE_QUESTION_MESSAGE, SAVE_QUESTION_TITLE, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, JOptionPane.YES_OPTION); }//w w w . ja v a 2 s . c o m }