2016-11-16 2 views
0

Я пытался получить строку со входа JSpinner.Как разбираться с String от JSpinner?

Как я могу разобрать вход для строки?

Я пробовал:

JSpinner jSpinner = (JSpinner) e.getSource(); 
    dates = (Date) jSpinner.getValue(); 
    DateFormat df = new SimpleDateFormat("HH:mm dd-MM-yyyy"); 
    ta2.setText(df.parse((String)jSpinner.getValue())); 
    // or this, which works but it throws an exception because of date. 
    ta2.setText((String)jSpinner.getValue()); 

ответ

0

Это было как-то просто сейчас она работает.

Я добавил:

String nt = df.format(dates); 
Смежные вопросы