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


Java Button.setMaxHeight方法代码示例

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


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

示例1: updateButtons

import javafx.scene.control.Button; //导入方法依赖的package包/类
private void updateButtons() {
    ObservableList<Button> buttons = this.getButtons();
    this.container.getChildren().clear();

    for (int i = 0; i < this.getButtons().size(); ++i) {
        Button button = buttons.get(i);
        button.getStyleClass().removeAll(ONLY_BUTTON, LEFT_PILL, CENTER_PILL, RIGHT_PILL);
        button.setMaxHeight(Double.MAX_VALUE);
        this.container.getChildren().add(button);
        if (i == buttons.size() - 1) {
            if (i == 0) {
                button.getStyleClass().add(ONLY_BUTTON);
            } else {
                button.getStyleClass().add(RIGHT_PILL);
            }
        } else if (i == 0) {
            button.getStyleClass().add(LEFT_PILL);
        } else {
            button.getStyleClass().add(CENTER_PILL);
        }
    }

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

示例2: addToolBar

import javafx.scene.control.Button; //导入方法依赖的package包/类
private void addToolBar() {
    TextField textField = new TextField();
    textField.getStyleClass().add("search-field");
    textField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());

    Text clearIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.TIMES_CIRCLE, "18");
    CustomTextField customTextField = new CustomTextField();
    customTextField.getStyleClass().add("search-field");
    customTextField.setLeft(FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.SEARCH, "18px"));
    customTextField.setRight(clearIcon);
    customTextField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());
    clearIcon.setOnMouseClicked(evt -> customTextField.setText(""));

    FlipPanel searchFlipPanel = new FlipPanel();
    searchFlipPanel.setFlipDirection(Orientation.HORIZONTAL);
    searchFlipPanel.getFront().getChildren().add(textField);
    searchFlipPanel.getBack().getChildren().add(customTextField);
    searchFlipPanel.visibleProperty().bind(getSkinnable().enableSortingAndFilteringProperty());

    getSkinnable().useControlsFXProperty().addListener(it -> {
        if (getSkinnable().isUseControlsFX()) {
            searchFlipPanel.flipToBack();
        } else {
            searchFlipPanel.flipToFront();
        }
    });

    showTrailerButton = new Button("Show Trailer");
    showTrailerButton.getStyleClass().add("trailer-button");
    showTrailerButton.setMaxHeight(Double.MAX_VALUE);
    showTrailerButton.setOnAction(evt -> showTrailer());

    BorderPane toolBar = new BorderPane();
    toolBar.setLeft(showTrailerButton);
    toolBar.setRight(searchFlipPanel);
    toolBar.getStyleClass().add("movie-toolbar");

    container.add(toolBar, 1, 0);
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:40,代码来源:MovieViewSkin.java

示例3: createCells

import javafx.scene.control.Button; //导入方法依赖的package包/类
@Override
protected void createCells() {

    final Calendar calendar = calendarView.getCalendar();

    // For each year in the decade, add a button to the view.
    for (int i = 0; i < NUMBER_OF_DECADES * 10; i++) {

        final Button button = new Button();
        button.getStyleClass().add(CSS_CALENDAR_DECADES_VIEW_BUTTON);
        button.setMaxWidth(Double.MAX_VALUE);
        button.setMaxHeight(Double.MAX_VALUE);
        GridPane.setVgrow(button, Priority.ALWAYS);
        GridPane.setHgrow(button, Priority.ALWAYS);

        button.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                if (currentlyViewing.get() == View.DECADES) {
                    calendar.set(Calendar.YEAR, (Integer) button.getUserData());
                    currentlyViewing.set(View.YEAR);
                    calendarView.viewedDateProperty().set(calendar.getTime());
                }
            }
        });
        int rowIndex = i % 5;
        int colIndex = (i - rowIndex) / 5;

        add(button, rowIndex, colIndex);
    }
}
 
开发者ID:scourgemancer,项目名称:graphing-loan-analyzer,代码行数:32,代码来源:CalendarViewSkin.java

示例4: buildButton

import javafx.scene.control.Button; //导入方法依赖的package包/类
private Button buildButton(String text) {
    Button button = new Button(text);
    button.setMnemonicParsing(false);
    button.setMinWidth(USE_PREF_SIZE);
    button.setMaxWidth(USE_PREF_SIZE);
    button.setPrefWidth(30);

    button.setMinHeight(USE_PREF_SIZE);
    button.setMaxHeight(USE_PREF_SIZE);
    button.setPrefHeight(25);
    return button;
}
 
开发者ID:Kindrat,项目名称:cassandra-client,代码行数:13,代码来源:TableButtons.java


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