当前位置: 首页>>代码示例>>Java>>正文


Java VBox.setFillWidth方法代码示例

本文整理汇总了Java中javafx.scene.layout.VBox.setFillWidth方法的典型用法代码示例。如果您正苦于以下问题:Java VBox.setFillWidth方法的具体用法?Java VBox.setFillWidth怎么用?Java VBox.setFillWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.VBox的用法示例。


在下文中一共展示了VBox.setFillWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createControl

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
protected Node createControl() {
    RecurrenceView view = new RecurrenceView();

    Label label = new Label("Rule: " + view.getRecurrenceRule());
    label.setMaxWidth(300);
    label.setWrapText(true);

    view.recurrenceRuleProperty().addListener(it -> label.setText(view.getRecurrenceRule()));

    Separator separator = new Separator(Orientation.HORIZONTAL);

    VBox box = new VBox(20);
    box.setFillWidth(true);
    box.getChildren().addAll(view, separator, label);
    box.setAlignment(Pos.CENTER);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:20,代码来源:HelloRecurrenceView.java

示例2: wrap

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    TimeRangeView field = (TimeRangeView) node;

    Label label = new Label("Range:   " + field.getStartDate() + "    to    " + field.getEndDate());
    label.setMaxHeight(Double.MAX_VALUE);
    field.startDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));
    field.endDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));

    VBox box2 = new VBox(20, field, label);
    box2.setFillWidth(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    stackPane.getChildren().add(box2);

    HBox box = new HBox(stackPane);
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:24,代码来源:HelloTimeRangeView.java

示例3: getControlPanel

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
public Node getControlPanel() {
    VBox vBox = new VBox();
    vBox.setFillWidth(true);
    vBox.setSpacing(10);

    // button
    Button button = new Button("Create Entries");
    button.setMaxWidth(Double.MAX_VALUE);
    button.setOnAction(evt -> createEntries());
    VBox.setVgrow(button, Priority.NEVER);
    vBox.getChildren().add(button);

    // box
    comboBox = new ComboBox<>();
    comboBox.getItems().addAll(100, 1000, 2000, 3000, 10000, 100000, 1000000);
    comboBox.getSelectionModel().select(0);
    comboBox.setMaxWidth(Double.MAX_VALUE);
    vBox.getChildren().add(comboBox);

    // label
    label = new Label("Time: ");
    vBox.getChildren().add(label);

    // Separator
    Separator separator = new Separator(Orientation.HORIZONTAL);
    vBox.getChildren().add(separator);

    // sheet
    CalendarPropertySheet sheet = new CalendarPropertySheet(calendarView.getPropertySheetItems());
    VBox.setVgrow(sheet, Priority.ALWAYS);
    vBox.getChildren().add(sheet);

    return vBox;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:36,代码来源:HelloPerformance.java

示例4: getControlPanel

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
public Node getControlPanel() {
    VBox box = new VBox();
    box.setSpacing(5);
    box.setFillWidth(true);

    Button addWorkCalendar = new Button("Add Work Calendar");
    addWorkCalendar.setOnAction(evt -> addWorkCalendar());

    Button removeWorkCalendar = new Button("Remove Work Calendar");
    removeWorkCalendar.setOnAction(evt -> removeWorkCalendar());

    Button addWorkCalendarSource = new Button("Add Work Calendar Source");
    addWorkCalendarSource.setOnAction(evt -> addWorkCalendarSource());

    Button removeWorkCalendarSource = new Button(
            "Remove Work Calendar Source");
    removeWorkCalendarSource.setOnAction(evt -> removeWorkCalendarSource());

    box.getChildren().addAll(addWorkCalendar, removeWorkCalendar,
            addWorkCalendarSource, removeWorkCalendarSource);

    Button addFamilyCalendar = new Button("Add Family Calendar");
    addFamilyCalendar.setOnAction(evt -> addFamilyCalendar());

    Button removeFamilyCalendar = new Button("Remove Family Calendar");
    removeFamilyCalendar.setOnAction(evt -> removeFamilyCalendar());

    Button addFamilyCalendarSource = new Button(
            "Add Family Calendar Source");
    addFamilyCalendarSource.setOnAction(evt -> addFamilyCalendarSource());

    Button removeFamilyCalendarSource = new Button(
            "Remove Family Calendar Source");
    removeFamilyCalendarSource
            .setOnAction(evt -> removeFamilyCalendarSource());

    box.getChildren().addAll(new Separator(Orientation.HORIZONTAL),
            addFamilyCalendar, removeFamilyCalendar,
            addFamilyCalendarSource, removeFamilyCalendarSource);

    addWorkCalendar.setMaxWidth(Double.MAX_VALUE);
    removeWorkCalendar.setMaxWidth(Double.MAX_VALUE);
    addWorkCalendarSource.setMaxWidth(Double.MAX_VALUE);
    removeWorkCalendarSource.setMaxWidth(Double.MAX_VALUE);

    addFamilyCalendar.setMaxWidth(Double.MAX_VALUE);
    removeFamilyCalendar.setMaxWidth(Double.MAX_VALUE);
    addFamilyCalendarSource.setMaxWidth(Double.MAX_VALUE);
    removeFamilyCalendarSource.setMaxWidth(Double.MAX_VALUE);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:54,代码来源:HelloSourceView.java

示例5: GoogleCalendarCreateView

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
GoogleCalendarCreateView(Consumer<CalendarViewBean> onAccept) {
    nameField = new TextField();
    styleComboBox = new ComboBox<>();
    styleComboBox.getItems().setAll(Calendar.Style.values());
    styleComboBox.setButtonCell(new StyleCell());
    styleComboBox.setCellFactory(listView -> new StyleCell());

    Button acceptButton = new Button("Accept");
    acceptButton.disableProperty().bind(Bindings.or(Bindings.isEmpty(nameField.textProperty()), Bindings.isNull(styleComboBox.valueProperty())));
    acceptButton.setOnAction(evt -> {
        if (onAccept != null) {
            CalendarViewBean bean = new CalendarViewBean();
            bean.setName(nameField.getText());
            bean.setStyle(styleComboBox.getValue());
            onAccept.accept(bean);
        }
        close();
    });
    Button cancelButton = new Button("Cancel");
    cancelButton.setOnAction(evt -> close());

    GridPane gridPane = new GridPane();
    gridPane.add(new Label("Name"), 0, 0);
    gridPane.add(nameField, 1, 0);
    gridPane.add(new Label("Color"), 0, 1);
    gridPane.add(styleComboBox, 1, 1);
    gridPane.getStyleClass().add("center");
    gridPane.setVgap(5);
    gridPane.setHgap(5);
    gridPane.setPadding(new Insets(10));

    GridPane.setHgrow(nameField, Priority.ALWAYS);
    GridPane.setHgrow(styleComboBox, Priority.ALWAYS);

    ButtonBar buttonBar = new ButtonBar();
    buttonBar.getButtons().addAll(acceptButton, cancelButton);

    VBox bottomPane = new VBox();
    bottomPane.getChildren().addAll(new Separator(), buttonBar);
    bottomPane.getStyleClass().add("bottom");
    bottomPane.setFillWidth(true);
    bottomPane.setSpacing(10);

    setCenter(gridPane);
    setBottom(bottomPane);
    setPadding(new Insets(15));
    setPrefWidth(300);
    getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm());
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:50,代码来源:GoogleCalendarCreateView.java

示例6: ICalWebSourcePane

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
public ICalWebSourcePane() {
    urlField = new TextField();
    urlField.setPrefWidth(300);
    nameField = new TextField();
    styleComboBox = new ComboBox<>();
    styleComboBox.getItems().setAll(Calendar.Style.values());
    styleComboBox.setButtonCell(new StyleCell());
    styleComboBox.setCellFactory(listView -> new StyleCell());

    acceptButton = new Button("Accept");
    cancelButton = new Button("Cancel");

    GridPane gridPane = new GridPane();
    gridPane.add(new Label("URL"), 0, 0);
    gridPane.add(urlField, 1, 0);
    gridPane.add(new Label("Name"), 0, 1);
    gridPane.add(nameField, 1, 1);
    gridPane.add(new Label("Color"), 0, 2);
    gridPane.add(styleComboBox, 1, 2);
    gridPane.getStyleClass().add("center");
    gridPane.setVgap(5);
    gridPane.setHgap(5);
    gridPane.setPadding(new Insets(10));

    GridPane.setHgrow(urlField, Priority.ALWAYS);
    GridPane.setHgrow(nameField, Priority.ALWAYS);
    GridPane.setHgrow(styleComboBox, Priority.ALWAYS);

    ButtonBar buttonBar = new ButtonBar();
    buttonBar.getButtons().addAll(acceptButton, cancelButton);

    VBox bottomPane = new VBox();
    bottomPane.getChildren().addAll(new Separator(), buttonBar);
    bottomPane.getStyleClass().add("bottom");
    bottomPane.setFillWidth(true);
    bottomPane.setSpacing(10);

    setCenter(gridPane);
    setBottom(bottomPane);
    getStyleClass().add("ical-web-source-pane");
    setPadding(new Insets(15));
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:43,代码来源:ICalWebSourcePane.java


注:本文中的javafx.scene.layout.VBox.setFillWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。