Forums Register Login

make jdatechooser and jyearchooser as non editable

+Pie Number of slices to send: Send
Hi ,

can anybody show me how to make the
jmonthchooser and jyearchoosr as non editable.

i could make the jdatechooser as non editable by
using the following statements

((JTextFieldDateEditor)jDateChooser3.getDateEditor()).setEditable(false);

but i could not find anything similar to this for month and year chooser

please help

regards,

Ivin
+Pie Number of slices to send: Send
Its a class from the library jcalendar.jar

jmonthchooser and jyearchooser areswing components available in the library used for selecting month and year.

i got it done by the following snippet

{code}

JSpinner spinner = (JSpinner)jYearChooser1.getSpinner();
((javax.swing.JTextField)spinner.getEditor()).setEditable(false);

{code}

Thanks,

Ivin
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 7080 times.
Similar Threads
how to make jtable non-editable
non-editable in textarea
Converting non-editable pdfs to editable pdfs
how to make Jtable Cells non Editable
JDateChooser
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:23:58.