• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting numbers and calculating them in jTable  RSS feed

 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,what I am trying to do on jtable is when a user enters values of numbers in the table, by click of button, those numbers are calculated and display in another column. For example, 4 = 2 + 2 in a table.This means getting inputs from user and summing them up. My getRowCount() and getValueAt() methods don't seem to work for me recently. I hope this forum can do me some good. Thanks in advance.
 
Campbell Ritchie
Sheriff
Posts: 53774
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't do any calculations in a JTable. Create a calculations class which does them
 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick response. I will tRy and get back here.
 
Campbell Ritchie
Sheriff
Posts: 53774
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome Do show us how far you have got.
 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your guide. I wrote a simple class that allows me to do that. I used the jTable swing component on the NetBeans IDE. Here is the simple class:


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!