Try the following:
See JOptionPane Documentation
JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
where options specify buttons with initialValue. Therefore you can change them
Example
Object[] options = { "Agree", "Disagree" }; JOptionPane.showOptionDialog(null, "Are you want to continue the process?", "information", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
Maxim shoustin
source share