當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。