JTable to show several sets of data

D

Dag Sunde

I have a scenarion where I'm struggling a little bit
on what is the best approach:

My base set of data to show is a Bid
- Coloumn headers are the prices,
- 24 rows one for each hour in the day
- the data is volumes for each price/hour
- The user can add new columns
- A bid always have two columns (minprice & maxPrice)
that can't be changed by the user

The user can add new bids (I maintain a collection of Bid)

The Gui represent different Bids as Tabs the user can click
on to select a particular bid to vork with.

Now to my question:

Do I put a datamodel into each bid, and use
table.setModel(bid.model), or do I use a single datamodel
and write code in that model to retrive data from the "current"
bid, and call .fireTableStructureChanged() to inform the table
that it have to redraw itself from scratch?

Or does anyone have a cpmpletely different idea?

TIA...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top