當前位置: 首頁>>代碼示例>>Java>>正文


Java HBox.setMaxSize方法代碼示例

本文整理匯總了Java中javafx.scene.layout.HBox.setMaxSize方法的典型用法代碼示例。如果您正苦於以下問題:Java HBox.setMaxSize方法的具體用法?Java HBox.setMaxSize怎麽用?Java HBox.setMaxSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.layout.HBox的用法示例。


在下文中一共展示了HBox.setMaxSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createGrid

import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void createGrid() {
    
    gridOperator.traverseGrid((i,j)->{
        gridGroup.getChildren().add(createCell(i, j));
        return 0;
    });

    gridGroup.getStyleClass().add("game-grid");
    gridGroup.setManaged(false);
    gridGroup.setLayoutX(BORDER_WIDTH);
    gridGroup.setLayoutY(BORDER_WIDTH);

    HBox hBottom = new HBox();
    hBottom.getStyleClass().add("game-backGrid");
    hBottom.setMinSize(gridWidth, gridWidth);
    hBottom.setPrefSize(gridWidth, gridWidth);
    hBottom.setMaxSize(gridWidth, gridWidth);
    
    // Clip hBottom to keep the dropshadow effects within the hBottom
    Rectangle rect = new Rectangle(gridWidth, gridWidth);
    hBottom.setClip(rect);
    hBottom.getChildren().add(gridGroup);
    
    vGame.getChildren().add(hBottom);
}
 
開發者ID:juebanlin,項目名稱:util4j,代碼行數:26,代碼來源:Board.java

示例2: CalendarToolBar

import javafx.scene.layout.HBox; //導入方法依賴的package包/類
public CalendarToolBar(CalendarView calendarView) {
    this.calendarView = calendarView;

    getStyleClass().addAll("module-toolbar", "calendar-toolbar", "primary-color-calendar");

    ToggleGroup group = new ToggleGroup();

    ToggleButton showDay = new ToggleButton("DAY");
    ToggleButton showWeek = new ToggleButton("WEEK");
    ToggleButton showMonth = new ToggleButton("MONTH");
    ToggleButton showYear = new ToggleButton("YEAR");

    showDay.setOnAction(evt -> showDayPage());
    showWeek.setOnAction(evt -> showWeekPage());
    showMonth.setOnAction(evt -> showMonthPage());
    showYear.setOnAction(evt -> showYearPage());

    showDay.getStyleClass().add("first");
    showYear.getStyleClass().add("last");

    showDay.setSelected(true);
    showDay.setMaxHeight(Double.MAX_VALUE);
    showWeek.setMaxHeight(Double.MAX_VALUE);
    showMonth.setMaxHeight(Double.MAX_VALUE);
    showYear.setMaxHeight(Double.MAX_VALUE);

    group.getToggles().addAll(showDay, showWeek, showMonth, showYear);

    HBox switcher = new HBox(showDay, showWeek, showMonth, showYear);
    switcher.getStyleClass().add("switcher");
    switcher.setFillHeight(true);
    switcher.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    HBox.setHgrow(switcher, Priority.ALWAYS);

    CustomTextField searchField = new CustomTextField();
    Button clearSearchButton = new Button();
    clearSearchButton.getStyleClass().add("clear-search");
    clearSearchButton.setOnAction(evt -> searchField.setText(""));
    searchField.setRight(clearSearchButton);
    searchField.setPromptText("SEARCH");
    searchField.setPrefColumnCount(30);

    SearchResultView searchResultView = calendarView.getSearchResultView();
    searchResultView.searchTextProperty().bind(searchField.textProperty());

    getChildren().addAll(switcher, searchField);
    setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
}
 
開發者ID:dlemmermann,項目名稱:JProCalendarFX,代碼行數:49,代碼來源:CalendarToolBar.java


注:本文中的javafx.scene.layout.HBox.setMaxSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。