com.jfoenix.controls.JFXDatePicker Java Examples

The following examples show how to use com.jfoenix.controls.JFXDatePicker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DatePickerDemo.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
@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);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(MainDemo.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
                       MainDemo.class.getResource("/css/jfoenix-design.css").toExternalForm());
    stage.setTitle("JFX Date Picker Demo");
    stage.setScene(scene);
    stage.show();

}
 
Example #2
Source File: FormBuilder.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public static Tuple2<Label, DatePicker> addTopLabelDatePicker(GridPane gridPane,
                                                              int rowIndex,
                                                              String title,
                                                              double top) {
    DatePicker datePicker = new JFXDatePicker();

    final Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, datePicker, top);

    return new Tuple2<>(topLabelWithVBox.first, datePicker);
}
 
Example #3
Source File: MainScene.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
/**
	 * Creates the earth time bar
	 */
	public void createEarthTimeBar() {

		if (masterClock == null)
			masterClock = sim.getMasterClock();

		if (earthClock == null)
			earthClock = masterClock.getEarthClock();

		datePickerFX = new JFXDatePicker();
		datePickerFX.setValue(earthClock.getLocalDate());
		datePickerFX.setEditable(false);
		// datePickerFX.setDefaultColor(Color.valueOf("#065185"));
		// datePickerFX.setOverLay(true);
		datePickerFX.setShowWeekNumbers(true);
		datePickerFX.setPromptText("Earth Date");
		datePickerFX.setId("earth-time");

		setQuickToolTip(datePickerFX, "Earth Date");

		timePickerFX = new JFXTimePicker();
		timePickerFX.setValue(earthClock.getLocalTime());

		timePickerFX.setEditable(false);
		// timePickerFX.setDefaultColor(Color.valueOf("#065185"));
		// blueDatePicker.setOverLay(true);
		timePickerFX.setPromptText("Earth Time");
		timePickerFX.setId("earth-time");
//		timePickerFX.set24HourView(true);
		
		setQuickToolTip(timePickerFX, "Earth Time in UTC");

		HBox box = new HBox(5, datePickerFX, timePickerFX);

		earthTimeBox = new HBox(box);
		earthTimeBox.setId("earth-time-box");
		earthTimeBox.setAlignment(Pos.CENTER);

		if (OS.contains("linux")) {
			earthTimeBox.setPrefSize(50, 25); // 270
			datePickerFX.setPrefSize(25, 25);// 160, 29);
			timePickerFX.setPrefSize(25, 25);// 140, 29);
		} else if (OS.contains("mac")) {
			earthTimeBox.setPrefSize(50, 23); // 230
			datePickerFX.setPrefSize(23, 23);
			timePickerFX.setPrefSize(23, 23);
		} else {
			earthTimeBox.setPrefSize(50, 25);
			datePickerFX.setPrefSize(25, 25);// 130, 25);
			timePickerFX.setPrefSize(25, 25);// 110, 25);
		}

	}