Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getValueAt()

 
VIV sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

in my code i need to know -->

jtable.getValueAt(1,3); returns int, String, Date etc... ?

means what is the value of this cell.


waiting for your reply

Thanks in Advance
viv
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It returns String that could be converted into any type.
 
Ashish Vegaraju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Viv,

jTable.getValueAt(1,3) returns an "object".

u can convert this object to String by using "obj.toString();".

u can then also convert this String to Date (if the cell contains a date value) by using the valueOf(String str) method...

"dateObj.valueOf(obj.toString());"

Ashish.
 
VIV sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys,

now it's working
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!