Results 1 to 20 of 21
Thread: JTable Calculation libraries
 09132010, 03:12 PM #1Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
 09132010, 03:29 PM #2Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
So the data is sent in Excel format?
Or what?
If Excel then you're looking at POI, JExcel, or one of the pay for license ones.
If not, then you'll have to say what the output is.
 09132010, 03:32 PM #3Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
hello world
Last edited by shy_ted; 09242010 at 03:20 PM.
 09132010, 03:41 PM #4Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
If this is just a data dump from the db, who cares what the users do with it?
You need to know what format this is supposed to be in before you can go anywhere with it...I assume that's in some requirements spec?
 09132010, 03:46 PM #5Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
hello world
Last edited by shy_ted; 09242010 at 03:20 PM.
 09132010, 03:50 PM #6Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
So when you say "spreadsheet" above in the OP, you meant you were having to write the spreadsheet code, and you weren't simply exporting the data as a spreadsheet...because that was far from clear from that post.
So, at the moment, you want to make your own cut down version of Excel?
Or is it simpler than that?
 09132010, 03:52 PM #7Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
hello worldto look.
Last edited by shy_ted; 09242010 at 03:20 PM.
 09132010, 04:08 PM #8Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
OK.
You may be able to use POI. I've not done this (I've only imported from and exported to excel files). There are methods for adding formulae to a cell, and then you can get the nonformula value from that Cell object.
I suspect you'd therefore have a POI Workbook with a Sheet sat behind your JTable. Anything the user enters into the front gets passed on to the Sheet, and any results are passed back to be displayed on the JTable.
How you wire these two things together is a task...I assume some form of table model, but it';s not something I've done and there are others here better at Swing than I am.
 09132010, 04:14 PM #9
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,389
 Blog Entries
 7
 Rep Power
 25
I have the feeling that this is all the wrong way around: excel is good at manipulation cells so leave that to excel and don't try to mimick it. Excel doesn't seem so good at other things so you should try to take care of that.
kind regards,
Jos
 09132010, 04:47 PM #10Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
That would be my view, but it sounds like this is a project from their tutor...so anything goes.
 09132010, 05:02 PM #11Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
hello world
Last edited by shy_ted; 09242010 at 03:20 PM.
 09132010, 05:08 PM #12Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
Which does beg the question of whether this is actually what they want.
 09132010, 05:09 PM #13Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
a hello world
Last edited by shy_ted; 09242010 at 03:21 PM.
 09132010, 05:48 PM #14
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,389
 Blog Entries
 7
 Rep Power
 25
Note that the Excel computable 'paradigm' (I like writing that word ;) is quite a limited one and mainly targeted at the visualization of simple algebraic calculations. If the model of those cells comes from somewhere else (something that doesn't know about that paradigm (I did it again!) you are not forced to do your calculation in that paradigm (my nipples explode in delight!) either. Just the result of your calculations need to be exported to that bloody excel format; POI or jExcel are perfect for that. If I were you I'd stay as far away as possible from that excel paradigm (aaahhhh).
kind regards,
Jos ;)
 09142010, 08:55 AM #15Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
hello world work and is simple?
Last edited by shy_ted; 09242010 at 03:21 PM.
 09142010, 10:25 AM #16
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,389
 Blog Entries
 7
 Rep Power
 25
So you want to be able to perform rudimentary Excellike calculations? You have to write an expression parser and interpreter (constants, cell references, operators etc.) and extensive checks to avoid cycles in the evaluation (e.g. A1= B1+1; B1= A1+1). That'd be quite a task ...
kind regards,
Jos
 09142010, 10:31 AM #17Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
Ask your tutor what library it is they are expecting you to use, since they said that there was one available on the web.
 09142010, 02:09 PM #18Member
 Join Date
 Sep 2010
 Posts
 19
 Rep Power
 0
we are supposed to find it, so i thought where better to ask than a java forum for some help....
 09142010, 02:16 PM #19Moderator
 Join Date
 Apr 2009
 Posts
 13,126
 Rep Power
 23
The only thing I can think, if they mean for you to mimic Excel functions, is POI.
The thing is, I doubt there are many people who would bother to write their own spreadsheet software.
 09142010, 02:17 PM #20
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,389
 Blog Entries
 7
 Rep Power
 25
After googling for 37 seconds I found this link. (I googled for "Java spreadsheet").
kind regards,
Jos aka your friendly Google service
Similar Threads

Help with the calculation of a variable.
By rarschach in forum New To JavaReplies: 14Last Post: 01242010, 03:50 PM 
Need help with doing a calculation in Java
By John D. in forum New To JavaReplies: 6Last Post: 02252009, 12:44 AM 
Delay on inputs during calculation
By matt_well in forum New To JavaReplies: 14Last Post: 07262008, 04:17 PM 
Area Calculation: Add, Substract, XOR
By Java Tip in forum java.awtReplies: 0Last Post: 06222008, 11:08 PM 
Problem with Calculation ....
By danny000 in forum New To JavaReplies: 1Last Post: 04152008, 02:42 PM
Bookmarks