JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

Show calendar date and Time picker by pressing a usual javafx button #105

Closed moctavianro closed 5 years ago

moctavianro commented 5 years ago

There is a way to open a calendar date and time picker dialog by pressing a button? Thanks

tbee commented 5 years ago

The picker is an independent component, so there is nothing stopping you from putting it in a popup and opening that via a button. That is exactly what the text field does. See setupPopup here https://github.com/JFXtras/jfxtras/blob/9.0/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarTextFieldSkin.java

moctavianro commented 5 years ago

Actually i was wondering if on button pressed i can show it as a dialog, something like CalendarTimePicker.build().show, without create a new dialog bla bla bla

tbee commented 5 years ago

The picker is a control, just like a textfield, button, etc. So the answer is no; just like textfield you have to provide a context (window) for it.