Is there any way to show just the calendar that is...
# tornadofx
s
Is there any way to show just the calendar that is psrt of datepicker instead of it being a popup of the text component?
a
Can you explain what you are trying to achieve?
s
basically, instead of the text ui datepicker that allows you to type in a date or alternative pop up the calendar to choose the date. I just want to show the calendar directly and let the user choose a date.
a
The calendar takes up much space. Therefore it was placed as a pop-up.
if you want the user to not type, the textfield can be disabled
s
yeah i get the use of the component as it is. its a great piece. But in my particular case im already popping a small dialog that is centered around the user choosing a date. The typical use case would be that they are choosing a date very near to the current day (or current value), so being able to quickly click is preferable to typing.
r
You can look into the
com.sun.javafx.scene.control.DatePickerContent
class, but it appears to require a
DatePicker
.
s
Thanks. Ill take a look. I dont mind having to create a datepicker that i dont show as long as i can show the calendar
I had to copy the java and make my own version to make a few tiny changes (mainly too much was package private), but this will work just fine! Thanks a lot Ruckus,
r
com.sun will not work in later javafx version 🙂 just warning you
s
Well as of how im still on 8 anyways, but yeah id have to look at how much DatePickerContent (and thus my copied version) is using from com.sun. The class itself was package private as well as some other things it was calling so ive pulled those things out. So hopefully i dont run into that later down the road.