-----Original Message-----
From: Keith Bennett <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, May 26, 2001 08:25
Subject: Problems Using JTable for Calendar
>All -
>
>I'm implementing a calendar widget that allows a user to select a date
>with a familiar and (hopefully) convenient visual display.
>
>1) Is there a way to prevent the user from scrolling to the unused day
>cells?
Do you mean to stop them selecting unused day cells? Use a custom
ListSelectionModel that only allows valid cells to be selected. Remember
that you need two selection models - one for rows, one for columns - set the
'rows' one on the table, and the columns one on the TableColumnModel.
>2) I have a ListSelectionListener that changes the underlying day (a
>member int) when the user cursors around the calendar. But it only gets
>an event when the user moves to a different row, not a different
>column. (I want to catch this event so that when the user changes year
>or month, I can select the cell of that same day number.)
I suspect that you are not listening to events from the TableColumnModel.
>Would it be better not to use a JTable, but some kind of text field or
>button components in a GridLayout instead? Then I'd have to implement
>some way to allow the up and down arrow keys to behave as expected.
I use a JTable perfectly well. I'd expect not doing so would create a lot of
extra work.
>Alternatively, if there is a better widget already available, I'm open
>to using that instead.
There may be one on IBM's developerWorks/alphaWorks sites, I'm not sure -
I've written my own, but unfortunately cannot make the code public.
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing