خرید بک لینک

Vote count: 0

I have a method getDate which retus 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){
          retu JOptionPane.showInputDialog(null, info, "Date insertion", JOptionPane.PLAIN_MESSAGE);
    }

This is how this InputDialog looks like:

IMAGE

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){
      retu JOptionPane.showOptionDialog(null,info,
                "Date insertion", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,null,options,
                null);
}

But it says "caot convert from int to String" and I need it to retu String not int.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 21 فروردين 1395 ساعت: 16:52

صفحه بندی