I have a method getDate which returns String value. I'd like to add custom buttons but I can't because Eclipse tells me to change method type to int instead of String. What can I do here?
public String getDate(String info){
return JOptionPane.showInputDialog(null, info, "Date insertion", JOptionPane.PLAIN_MESSAGE);
}
This is how this InputDialog looks like:
I want this dialog to have let's say Yes/No/Quit buttons and if I understand correctly, code like this should work:
public String getDate(String info){
return JOptionPane.showOptionDialog(null,info,
"Date insertion", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,null,options,
null);
}
But it says "cannot convert from int to String" and I need it to return String not int.