Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 JavaFX 应用程序使用 FXML,并且在其中一种形式中,它需要显示给定月份的约会日期。然后,用户可以单击一个日期来添加一个新约会。为此,我想使用 JFX Extra CalendarPicker(此处)。我不知道它是否是正确的图书馆,但我认为CalendarPicker如果它可以完成这项工作是更可取的。有人可以告诉我怎么做吗?
CalendarPicker
控制项目有一个 CalendarPickerFXMLTest,它显示了如何在 FXML 中做一个日历选择器。
https://github.com/JFXtras/jfxtras/blob/8.0/jfxtras-controls/src/test/resources/jfxtras/scene/control/test/CalendarPickerFXMLTest.fxml
确保将所有必需的 jar 添加到项目中,例如 jfxtras-common 和可能的 jfxtras-fxml。在 Java 中访问 fxml 中定义的 CalendarPicker 控件后,您可以设置突出显示的日历列表。如果突出显示的样式不适合您,您可以使用 .highlight 类在 CSS 中更改它
https://github.com/JFXtras/jfxtras/blob/8.0/jfxtras-controls/src/main/resources/jfxtras/internal/scene/control/CalendarPicker.css