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


Java TitledPane.setPrefWidth方法代碼示例

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


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

示例1: buildCusTree

import javafx.scene.control.TitledPane; //導入方法依賴的package包/類
private void buildCusTree() {
	VBox vBox = new VBox();
	for (int i = 0; i < 10; i++) {
		VBox vBox2 = new VBox();
		vBox2.getChildren().add(new Text("One"));
		vBox2.getChildren().add(new Text("Two"));
		vBox2.getChildren().add(new Text("Three"));
		vBox2.getChildren().add(new Text("Four"));
		vBox2.getChildren().add(new Text("Five"));
		vBox2.getChildren().add(new Text("Six"));
		
		TitledPane tp = new TitledPane();
		tp.setPrefWidth(200);
		//tp.setExpanded(i%2==0 ? true :false);
		tp.setText("Title Pane "+i);
		tp.setContent(vBox2);
		
		vBox.getChildren().add(tp);
	}
	
	root.getChildren().add(vBox);
}
 
開發者ID:SaiPradeepDandem,項目名稱:javafx-demos,代碼行數:23,代碼來源:AccordianDemo.java

示例2: showResultPane

import javafx.scene.control.TitledPane; //導入方法依賴的package包/類
private void showResultPane(TitledPane resultPane) {
	resultPane.setPrefWidth(outputScrollPane.getViewportBounds().getWidth());
	resultPane.setMaxWidth(outputScrollPane.getViewportBounds().getWidth());
	resultPane.setMinWidth(outputScrollPane.getViewportBounds().getWidth());
	outputScrollPane.viewportBoundsProperty().addListener((observer, oldValue, newValue) -> {			
		resultPane.setPrefWidth(newValue.getWidth());
		resultPane.setMinWidth(newValue.getWidth());
		resultPane.setMaxWidth(newValue.getWidth());
	});
	outputAccordion.getPanes().add(0, resultPane);
	resultPane.setExpanded(true);
	outputScrollPane.setVvalue(0);
}
 
開發者ID:aic-sri-international,項目名稱:aic-praise,代碼行數:14,代碼來源:QueryController.java

示例3: create

import javafx.scene.control.TitledPane; //導入方法依賴的package包/類
public AnchorPane create() throws Exception {
    AnchorPane anchorPane = new AnchorPane();
    anchorPane.setId("AnchorPane");
    anchorPane.setMinHeight(Control.USE_PREF_SIZE);
    anchorPane.setMinWidth(Control.USE_PREF_SIZE);
    anchorPane.setPrefHeight(Control.USE_COMPUTED_SIZE);
    anchorPane.setPrefWidth(Control.USE_COMPUTED_SIZE);
    TitledPane titledPane = new TitledPane();
    titledPane.setAnimated(false);
    titledPane.setCollapsible(false);
    titledPane.setPrefHeight(Control.USE_COMPUTED_SIZE);
    titledPane.setPrefWidth(Control.USE_COMPUTED_SIZE);
    titledPane.setText(bundle.getString("GSSCopySection"));
    AnchorPane.setBottomAnchor(titledPane, 0.0);
    AnchorPane.setLeftAnchor(titledPane, 0.0);
    AnchorPane.setRightAnchor(titledPane, 0.0);
    AnchorPane.setTopAnchor(titledPane, 0.0);
    VBox vBox3 = new VBox();
    vBox3.setPrefHeight(Control.USE_COMPUTED_SIZE);
    vBox3.setPrefWidth(Control.USE_COMPUTED_SIZE);
    vBox3.setSpacing(5.0);
    controlCopyrightNotice = new TextArea();
    controlCopyrightNotice.setMinHeight(50.0);
    controlCopyrightNotice.setMinWidth(100.0);
    controlCopyrightNotice.setPrefWidth(Control.USE_COMPUTED_SIZE);
    controlCopyrightNotice.setPromptText(bundle.getString("GSSCopySection_Desc"));
    controlCopyrightNotice.setWrapText(true);
    VBox.setVgrow(controlCopyrightNotice, Priority.ALWAYS);
    vBox3.getChildren().add(controlCopyrightNotice);
    Insets insets5 = new Insets(10.0, 10.0, 10.0, 10.0);
    vBox3.setPadding(insets5);
    titledPane.setContent(vBox3);
    anchorPane.getChildren().add(titledPane);
    initialize(null, bundle);
    return anchorPane;
}
 
開發者ID:DigiArea,項目名稱:closurefx-builder,代碼行數:37,代碼來源:GSSCopySectionController.java

示例4: create

import javafx.scene.control.TitledPane; //導入方法依賴的package包/類
public AnchorPane create() throws Exception {
    AnchorPane anchorPane37 = new AnchorPane();
    anchorPane37.setId("AnchorPane");
    anchorPane37.setMinHeight(Control.USE_PREF_SIZE);
    anchorPane37.setMinWidth(Control.USE_PREF_SIZE);
    anchorPane37.setPrefHeight(Control.USE_COMPUTED_SIZE);
    anchorPane37.setPrefWidth(Control.USE_COMPUTED_SIZE);
    TitledPane titledPane33 = new TitledPane();
    titledPane33.setAnimated(false);
    titledPane33.setCollapsible(false);
    titledPane33.setExpanded(true);
    titledPane33.setPrefHeight(Control.USE_COMPUTED_SIZE);
    titledPane33.setPrefWidth(Control.USE_COMPUTED_SIZE);
    titledPane33.setText(bundle.getString("SOYStyleSection"));
    AnchorPane.setBottomAnchor(titledPane33, 0.0);
    AnchorPane.setLeftAnchor(titledPane33, 0.0);
    AnchorPane.setRightAnchor(titledPane33, 0.0);
    AnchorPane.setTopAnchor(titledPane33, 0.0);
    VBox vBox65 = new VBox();
    vBox65.setPrefHeight(Control.USE_COMPUTED_SIZE);
    vBox65.setPrefWidth(Control.USE_COMPUTED_SIZE);
    Label label80 = new Label();
    label80.setMinWidth(100.0);
    label80.setText(bundle.getString("SOYStyleSection_Desc"));
    label80.setWrapText(true);
    vBox65.getChildren().add(label80);
    GridPane gridPane74 = new GridPane();
    gridPane74.setHgap(5.0);
    controlCodeStyleBuilder = new RadioButton();
    controlCodeStyleBuilder.setMnemonicParsing(false);
    controlCodeStyleBuilder.setText(bundle.getString("SOYStyleSection_String"));
    GridPane.setColumnIndex(controlCodeStyleBuilder, 0);
    GridPane.setRowIndex(controlCodeStyleBuilder, 0);
    styleGroup = new ToggleGroup();
    controlCodeStyleBuilder.setToggleGroup(styleGroup);
    gridPane74.getChildren().add(controlCodeStyleBuilder);
    controlCodeStyleConcat = new RadioButton();
    controlCodeStyleConcat.setMnemonicParsing(false);
    controlCodeStyleConcat.setText(bundle.getString("SOYStyleSection_Concatenation"));
    controlCodeStyleConcat.setToggleGroup(styleGroup);
    GridPane.setColumnIndex(controlCodeStyleConcat, 1);
    GridPane.setRowIndex(controlCodeStyleConcat, 0);
    gridPane74.getChildren().add(controlCodeStyleConcat);
    ColumnConstraints columnConstraints168 = new ColumnConstraints();
    columnConstraints168.setHgrow(Priority.NEVER);
    columnConstraints168.setMinWidth(Control.USE_COMPUTED_SIZE);
    columnConstraints168.setPrefWidth(Control.USE_COMPUTED_SIZE);
    gridPane74.getColumnConstraints().add(columnConstraints168);
    ColumnConstraints columnConstraints169 = new ColumnConstraints();
    columnConstraints169.setHgrow(Priority.NEVER);
    columnConstraints169.setMinWidth(Control.USE_COMPUTED_SIZE);
    columnConstraints169.setPrefWidth(Control.USE_COMPUTED_SIZE);
    gridPane74.getColumnConstraints().add(columnConstraints169);
    RowConstraints rowConstraints147 = new RowConstraints();
    rowConstraints147.setMinHeight(10.0);
    rowConstraints147.setPrefHeight(30.0);
    rowConstraints147.setVgrow(Priority.SOMETIMES);
    gridPane74.getRowConstraints().add(rowConstraints147);
    vBox65.getChildren().add(gridPane74);
    Insets insets100 = new Insets(10.0, 10.0, 10.0, 10.0);
    vBox65.setPadding(insets100);
    titledPane33.setContent(vBox65);
    anchorPane37.getChildren().add(titledPane33);
    initialize(null, bundle);
    return anchorPane37;
}
 
開發者ID:DigiArea,項目名稱:closurefx-builder,代碼行數:67,代碼來源:SOYStyleSectionController.java

示例5: create

import javafx.scene.control.TitledPane; //導入方法依賴的package包/類
public AnchorPane create() throws Exception {
    AnchorPane anchorPane11 = new AnchorPane();
    anchorPane11.setId("AnchorPane");
    anchorPane11.setMinHeight(Control.USE_PREF_SIZE);
    anchorPane11.setMinWidth(Control.USE_PREF_SIZE);
    anchorPane11.setPrefHeight(Control.USE_COMPUTED_SIZE);
    anchorPane11.setPrefWidth(Control.USE_COMPUTED_SIZE);
    TitledPane titledPane10 = new TitledPane();
    titledPane10.setAnimated(false);
    titledPane10.setPrefHeight(Control.USE_COMPUTED_SIZE);
    titledPane10.setPrefWidth(Control.USE_COMPUTED_SIZE);
    titledPane10.setText(bundle.getString("GSSVendorSection"));
    AnchorPane.setBottomAnchor(titledPane10, 0.0);
    AnchorPane.setLeftAnchor(titledPane10, 0.0);
    AnchorPane.setRightAnchor(titledPane10, 0.0);
    AnchorPane.setTopAnchor(titledPane10, 0.0);
    GridPane gridPane27 = new GridPane();
    gridPane27.setId("GridPane");
    gridPane27.setMinHeight(Control.USE_PREF_SIZE);
    gridPane27.setMinWidth(Control.USE_PREF_SIZE);
    gridPane27.setVgap(5.0);
    Label label21 = new Label();
    label21.setMaxHeight(Control.USE_COMPUTED_SIZE);
    label21.setMaxWidth(1.7976931348623157E308);
    label21.setMinHeight(Control.USE_COMPUTED_SIZE);
    label21.setMinWidth(100.0);
    label21.setPrefWidth(100.0);
    label21.setText(bundle.getString("GSSVendorSection_Desc"));
    label21.setWrapText(true);
    GridPane.setColumnIndex(label21, 0);
    GridPane.setHalignment(label21, HPos.LEFT);
    GridPane.setRowIndex(label21, 0);
    GridPane.setVgrow(label21, Priority.NEVER);
    gridPane27.getChildren().add(label21);
    controlVendor = new ComboBox();
    controlVendor.setMaxWidth(1.7976931348623157E308);
    controlVendor.setMinWidth(100.0);
    controlVendor.setPrefWidth(100.0);
    GridPane.setColumnIndex(controlVendor, 0);
    GridPane.setRowIndex(controlVendor, 1);
    gridPane27.getChildren().add(controlVendor);
    ColumnConstraints columnConstraints53 = new ColumnConstraints();
    columnConstraints53.setHgrow(Priority.SOMETIMES);
    columnConstraints53.setMaxWidth(1.7976931348623157E308);
    columnConstraints53.setMinWidth(100.0);
    columnConstraints53.setPrefWidth(200.0);
    gridPane27.getColumnConstraints().add(columnConstraints53);
    Insets insets27 = new Insets(10.0, 10.0, 10.0, 10.0);
    gridPane27.setPadding(insets27);
    RowConstraints rowConstraints50 = new RowConstraints();
    rowConstraints50.setMinHeight(Control.USE_PREF_SIZE);
    rowConstraints50.setVgrow(Priority.NEVER);
    gridPane27.getRowConstraints().add(rowConstraints50);
    RowConstraints rowConstraints51 = new RowConstraints();
    rowConstraints51.setMinHeight(Control.USE_PREF_SIZE);
    rowConstraints51.setVgrow(Priority.NEVER);
    gridPane27.getRowConstraints().add(rowConstraints51);
    titledPane10.setContent(gridPane27);
    anchorPane11.getChildren().add(titledPane10);
    initialize(null, bundle);
    return anchorPane11;
}
 
開發者ID:DigiArea,項目名稱:closurefx-builder,代碼行數:63,代碼來源:GSSVendorSectionController.java


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