Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

Select Cell on a Grid

Thread view: 
aleicaro@libero.it - 20 Jun 2005 09:54 GMT
Hi,
I have the following problem
I Have to represent the 24 hours in a "grid". with 2 rows. The first
row contain the Hours o'clock, and the second row the half hours.
--------------------
1   | 2  | 3  | 4  |
--------------------
1.30|2.30|3.30|4.30|
--------------------

I need to select single cells in this grid, but the selection is not
consequential.
I tried to use the JTable, but searching on the web, I found that with
JTable is not possible to select non consequentials single cells. For
example I need to select the cell "2" and the cell "4.30".

How can I do it?
Does anybody can suggest me a component that can help me to do this if
the JTable is not the right way?

Thank you
Alessandro Rossi
John B. Matthews - 21 Jun 2005 04:36 GMT
> Hi,
> I have the following problem
[quoted text clipped - 18 lines]
> Thank you
> Alessandro Rossi

Isn't the selection mode of DefaultListSelectionModel set to
MULTIPLE_INTERVAL_SELECTION by default? Or you can use setSelectionMode
to set it. Either way, you can then make non-contiguous selections.

Signature

John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/

aleicaro@libero.it - 21 Jun 2005 08:21 GMT
Yes, but if you select for example the cell (0,0) and the cell (10,10)
you'll select all the cells between 0,0 and 10,10 beacuse they aren't
on the same row. The  MULTIPLE_INTERVAL_SELECTION works properly only
if you are on the same row (or on the same column). That's what I have
understood.

Alessandro Rossi
John B. Matthews - 22 Jun 2005 05:39 GMT
> Yes, but if you select for example the cell (0,0) and the cell (10,10)
> you'll select all the cells between 0,0 and 10,10 beacuse they aren't
[quoted text clipped - 3 lines]
>
> Alessandro Rossi

I see now what you mean. MULTIPLE_INTERVAL_SELECTION allows one to
select rows 1, 3 and 5, or columns 2 and 4. But you need row 1, column 2
and row 2, column 5, for example.

Signature

John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.