0
我已經顯示日期值格式化MM/dd/yyyy,我希望它顯示jsinner jtablemouseclickedevent。我會怎麼做?我嘗試了這種代碼,但我得到一個錯誤:JTable日期值jspinner
我JTable有5列
ID = int type
Username = String type
Password = String type
Website = String type
Date Encoded = date/time type (MM/dd/yyyy)
這是我的代碼:
jLabel5.setText(jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString());
jTextField4.setText(jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString());
jTextField5.setText(jTable1.getValueAt(jTable1.getSelectedRow(), 2).toString());
jTextField6.setText(jTable1.getValueAt(jTable1.getSelectedRow(), 3).toString());
**jSpinner1.setValue(jTable1.getValueAt(jTable1.getSelectedRow(), 4));**
任何幫助,將不勝感激:) :) :)
你會得到什麼錯誤?你確定'getValueAt()'返回一個'Date'對象而不是'String'嗎? – Thomas 2011-03-21 08:30:17