use of com.jfoenix.controls.JFXDatePicker in project JFoenix by jfoenixadmin.
the class DatePickerDemo method start.
@Override
public void start(Stage stage) {
FlowPane main = new FlowPane();
main.setVgap(20);
main.setHgap(20);
DatePicker datePicker = new DatePicker();
main.getChildren().add(datePicker);
JFXDatePicker datePickerFX = new JFXDatePicker();
main.getChildren().add(datePickerFX);
datePickerFX.setPromptText("pick a date");
JFXTimePicker blueDatePicker = new JFXTimePicker();
blueDatePicker.setDefaultColor(Color.valueOf("#3f51b5"));
blueDatePicker.setOverLay(true);
main.getChildren().add(blueDatePicker);
StackPane pane = new StackPane();
pane.getChildren().add(main);
StackPane.setMargin(main, new Insets(100));
pane.setStyle("-fx-background-color:WHITE");
final Scene scene = new Scene(pane, 400, 700);
scene.getStylesheets().add(MainDemo.class.getResource("/resources/css/jfoenix-fonts.css").toExternalForm());
scene.getStylesheets().add(MainDemo.class.getResource("/resources/css/jfoenix-design.css").toExternalForm());
stage.setTitle("JFX Date Picker Demo");
stage.setScene(scene);
stage.show();
}
use of com.jfoenix.controls.JFXDatePicker in project JFoenix by jfoenixadmin.
the class JFXDatePickerSkin method show.
@Override
public void show() {
if (!((JFXDatePicker) getSkinnable()).isOverLay())
super.show();
if (content != null) {
content.init();
content.clearFocus();
}
if (((JFXDatePicker) getSkinnable()).isOverLay()) {
if (dialog == null) {
StackPane dialogParent = jfxDatePicker.getDialogParent();
if (dialogParent == null)
dialogParent = (StackPane) getSkinnable().getScene().getRoot();
dialog = new JFXDialog(dialogParent, (Region) getPopupContent(), DialogTransition.CENTER, true);
arrowButton.setOnMouseClicked((click) -> {
if (((JFXDatePicker) getSkinnable()).isOverLay()) {
StackPane parent = jfxDatePicker.getDialogParent();
if (parent == null)
parent = (StackPane) getSkinnable().getScene().getRoot();
dialog.show(parent);
}
});
}
}
}
use of com.jfoenix.controls.JFXDatePicker in project SmartCity-Market by TechnionYP5777.
the class ManagePackagesTab method initialize.
@Override
public void initialize(URL location, ResourceBundle __) {
barcodeEventHandler.register(this);
barcodeTextField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*"))
barcodeTextField.setText(newValue.replaceAll("[^\\d]", ""));
showScanCodePane(true);
resetParams();
searchCodeButton.setDisable(newValue.isEmpty());
});
editPackagesAmountSpinner.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
editPackagesAmountSpinner.valueProperty().addListener((obs, oldValue, newValue) -> {
if (newValue == null || newValue < 1)
editPackagesAmountSpinner.getValueFactory().setValue(oldValue);
enableRunTheOperationButton();
});
editPackagesAmountSpinner.focusedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null && !newValue) {
editPackagesAmountSpinner.increment(0);
enableRunTheOperationButton();
}
});
final Callback<DatePicker, DateCell> dayCellFactory = new Callback<DatePicker, DateCell>() {
@Override
public DateCell call(final DatePicker __) {
return new DateCell() {
@Override
public void updateItem(LocalDate item, boolean empty) {
super.updateItem(item, empty);
if (!item.isBefore(LocalDate.now()))
return;
setDisable(true);
setStyle("-fx-background-color: #EEEEEE;");
}
};
}
};
datePicker.setDayCellFactory(dayCellFactory);
datePicker.setValue(LocalDate.now());
VBox vbox = new VBox();
vbox.setPadding(new Insets(10, 50, 50, 50));
vbox.setSpacing(10);
datePickerForSmartCode = new JFXDatePicker();
Label lbl = new Label("Choose Date");
vbox.getChildren().addAll(lbl, datePickerForSmartCode);
JFXPopup popup = new JFXPopup(vbox);
showDatePickerBtn.setOnMouseClicked(e -> popup.show(showDatePickerBtn, PopupVPosition.TOP, PopupHPosition.LEFT));
radioButtonContainerSmarcodeOperations.addRadioButtons(Arrays.asList(new RadioButton[] { printSmartCodeRadioButton, addPackageToStoreRadioButton, removePackageFromStoreRadioButton, removePackageFromWarhouseRadioButton }));
radioButtonContainerBarcodeOperations.addRadioButtons(Arrays.asList(new RadioButton[] { addPakageToWarhouseRadioButton }));
resetParams();
showScanCodePane(true);
}
Aggregations