0

How to set jDateChooser as readonly in JAVA? I need a non-editable jDateChooser for my project.

user3416315
  • 21
  • 1
  • 7
  • Does `setEnable(false)` make it so you can't change the value? Here are the **[docs](http://www.ssec.wisc.edu/mcidas/software/v/javadoc/1.4/edu/wisc/ssec/mcidasv/data/dateChooser/JDateChooser.html)**. –  Oct 01 '14 at 01:22
  • Thanks for your opinion but i need a readonly jDateChooser. Disabled jDateChooser just make the inputted date from the database blurred and not easily seen by the user. BTW thanks for the downvote. :/ – user3416315 Oct 01 '14 at 01:27
  • I didn't downvote your question. Try removing all event handlers. –  Oct 01 '14 at 01:33
  • Oh! sorry for that. I'll try that. Thanks. – user3416315 Oct 01 '14 at 01:47

1 Answers1

0

check the documentation here What you're are looking for is the enable mode (so if you set it to false, it will be non-editable)

adhg
  • 10,437
  • 12
  • 58
  • 94
  • What i mean is a setEditable in jTextField. Not just setEnable. I want the jDateChooser to be clearly seen. BTW Thanks for sharing the documentation. I'll read it later. – user3416315 Oct 01 '14 at 01:31
  • it will be 'clearly seen' but you will be 'grayed out' indicating the end-user that this field cannot be changed. Isn't it what you want by writing 'non-editable'? – adhg Oct 01 '14 at 01:33
  • Yes, grayed-out is what i mean. Sorry. I don't want my jDateChooser to be grayed-out as i set it non-editable. Is it possible? I don't want to use textbox to show dates because I want it to be more formal. – user3416315 Oct 01 '14 at 01:38
  • as far as I know - you can't. It's a 'GUI standard' it sends a signal to the end user that this can not be edited. Check the documentation. – adhg Oct 01 '14 at 01:43
  • Oh I see. Thanks. I've been searching the whole net for that. Now it's clear. – user3416315 Oct 01 '14 at 01:49