Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

make jdatechooser and jyearchooser as non editable  RSS feed

 
ivin jacob
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ivin jacob
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!