You could try JCalendar by Claude Duguay, published back in 1999.
He was writing for Java Developer's Journal back then.
See http://www.sys-con.com/java/archives/0403/duguay/index.html
The source is at http://www.sys-con.com/java/source/4-3/4-3.zip
The Digital Edition of the issue is at
http://www.sys-con.com/java/pdf/de9903.pdf
You may have to register is you haven't already.
He now writes an excellent column for JavaPro.

> -----Original Message-----
> From: Keith Bennett [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 26, 2001 2:20 PM
> To: [EMAIL PROTECTED]
> 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.  Here's an
> image of it so far:
> 
> http://www.cpcug.org/user/kbennett/fgm/DateDialogWithDesiredAs
pectRatio.gif

I'm using a JTable to manage the calendar days.  I chose a JTable
because the table model conveniently separates the data from the
presentation, and because it handles the horizontal and vertical
cursoring automatically.  However, I'm having some problems:

1) Is there a way to prevent the user from scrolling to the unused day
cells?

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.)

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.

Alternatively, if there is a better widget already available, I'm open
to using that instead.

Thanks for any help.

- Keith Bennett
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to