• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTABLE

 
thisum biddhika
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone please say how to create a spread-sheet using J-Table!
I encountered problems when accessing cells and retreving data by giving cell address.(10x10 spread sheet.)
 
Rob Spoor
Sheriff
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far? What are you storing in your table model, and how are you displaying it?
 
Mikko Kohtamäki
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I encountered problems when accessing cells and retreving data by giving cell address.(10x10 spread sheet.)

Yes, hard to say anything for that. What you got? Do you have just basic swing table / table model? Or do your cells / rows have a class instance of their own or something like that?

My whole table concept has ~3k lines of code and slowly growing. And it is not spread sheet model and will not be, well auto-create columns and functions are missing (replaced with other features).
[ December 19, 2008: Message edited by: Mikko Kohtam�ki ]
 
thisum biddhika
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
similar to a excel, but very simpler than that.

In each cell we have to store a literal integer value, a referential integer value (that is, a reference to the value stored at another cell) or an equation.

A referential integer value is stored as a string that starts with the symbol "=" followed by the target cell address expressed as a string.

An equation is entered as a string that starts with the symbol "=" and is an expression that may contain the operators "+", "-", "*" and "/" for addition, subtraction, multiplication and integer division. An expression may also contain the symbols "(" and ")" for group of sub-expressions but without nesting. The values in an expression may be literal integers or a reference to a value stored at a cell. The expressions are evaluated left-to-right without any specific operator precedence order. But sub-expression precedence is maintained.

A cell may store the special function "sum", which is the summation of values in a range of cells (either column-wise or row-wise). This special equation is represented as a string "=sum(start_address..end_address)".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic