aspose file tools
The moose likes Swing / AWT / SWT and the fly likes JTable problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JTable problem" Watch "JTable problem" New topic
Author

JTable problem

kevin bennett
Greenhorn

Joined: Aug 22, 2001
Posts: 15
I have a JTable that is the central part of a reservations program. It lists dates across the column header (each individual cell corresponds to a date), and items that can be reserved down the row header. Items can be reserved for one or more days.
This is what I am currently doing: The column header cells are populated with a custom date class that corresponds to each individual date, the row header is populated with a single-column table of item objects. When someone selects a range of cells (dates) for a specific object and clicks a "reserve" button I create a single reservation object and add it to each of the selected cells (dates).
My current problem is this: For a reservation that is more than one day long, each cell can be selected individually. I would like to have it so that any mouse click any of the cells (dates) that make up a single reservation results in all of the cells being selected. Ideally the cells would all become one cell, i.e. a seven day long reservation would result in the seven individual date cells becoming one single cell that is seven days long. I've tried this but haven't had too much luck. Any suggestions are welcome, from simple tips to suggestions of a better architecture for the entire table. Thanks.
Kevin
kevinallenbennett@yahoo.com
Steffen Foldager
Ranch Hand

Joined: Mar 22, 2001
Posts: 58
For starters, this is the page I always refer to for JTable Tips&Tricks:
http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
Lots of examples...
Steffen


Steffen Foldager<p>Sun Certified Java Programmer<br />Sun Certified Web Component Developer
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JTable problem
 
Similar Threads
Problem in JTable
JTable problem
JTable cell formatting
Problem with a JTable
Problem with setting the cell values in JTable