本文整理汇总了Java中javafx.scene.control.TitledPane.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TitledPane.setText方法的具体用法?Java TitledPane.setText怎么用?Java TitledPane.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TitledPane
的用法示例。
在下文中一共展示了TitledPane.setText方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActionAddProjectToDailySection
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
private void onActionAddProjectToDailySection(ProjectModel model) {
LoggerFacade.INSTANCE.debug(this.getClass(), "On action add Project to DailySection"); // NOI18N
final TitledPane titledPane = new TitledPane();
titledPane.setText("(1) " + model.getTitle()); // NOI18N
titledPane.setUserData(model);
titledPane.setExpanded(false);
final ProjectContentView view = new ProjectContentView();
final ProjectContentPresenter presenter = view.getRealPresenter();
presenter.configure(model);
titledPane.setContent(view.getView());
vbDailySectionContent.getChildren().add(0, titledPane);
this.onActionEnsureTitledPaneIsVisible(titledPane);
}
示例2: createObject
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
protected Object createObject(double width, double height, Double tab_width, Double tab_height) {
Label content = new Label("Content");
if (tab_width != null && tab_height != null) {
content.setMinSize(tab_width, tab_height);
content.setMaxSize(tab_width, tab_height);
content.setPrefSize(tab_width, tab_height);
}
TitledPane titled_pane = new TitledPane();
titled_pane.setText("Title");
titled_pane.setContent(content);
titled_pane.setMinSize(width, height);
titled_pane.setMaxSize(width, height);
titled_pane.setPrefSize(width, height);
titled_pane.setStyle("-fx-border-color: darkgray;");
return titled_pane;
}
示例3: start
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Pane root = new StackPane();
CheckBox bt = new CheckBox("eieieie");
StackPane sp = new StackPane(bt);
TitledPane tp = new TitledPane();
Scene myScene = new Scene(root, 402, 446);
tp.setLayoutX(20);
tp.setLayoutY(20);
tp.setText("foo");
tp.setMaxWidth(180);
tp.setMaxHeight(150);
AeroFX.styleGroupBox(tp);
AeroFX.style();
tp.setContent(sp);
root.getChildren().add(tp);
primaryStage.setScene(myScene);
primaryStage.show();
}
示例4: 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);
}
示例5: start
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
stage.setTitle("TitledPane");
Scene scene = new Scene(new Group(), 450, 250);
TitledPane gridTitlePane = new TitledPane();
GridPane grid = new GridPane();
grid.setVgap(4);
grid.setPadding(new Insets(5, 5, 5, 5));
grid.add(new Label("First Name: "), 0, 0);
grid.add(new TextField(), 1, 0);
grid.add(new Label("Last Name: "), 0, 1);
grid.add(new TextField(), 1, 1);
grid.add(new Label("Email: "), 0, 2);
grid.add(new TextField(), 1, 2);
grid.add(new Label("Attachment: "), 0, 3);
grid.add(label,1, 3);
gridTitlePane.setText("Grid");
gridTitlePane.setContent(grid);
final Accordion accordion = new Accordion ();
for (int i = 0; i < imageNames.length; i++) {
images[i] =
new Image(getClass().getResourceAsStream(imageNames[i]+".jpg"));
pics[i] = new ImageView(images[i]);
tps[i] = new TitledPane(imageNames[i],pics[i]);
}
accordion.getPanes().addAll(tps);
accordion.expandedPaneProperty().addListener(
(ObservableValue<? extends TitledPane> ov, TitledPane old_val,
TitledPane new_val) -> {
if (new_val != null) {
label.setText(accordion.getExpandedPane().getText()
+ ".jpg");
}
});
HBox hbox = new HBox(10);
hbox.setPadding(new Insets(20, 0, 0, 20));
hbox.getChildren().setAll(gridTitlePane, accordion);
Group root = (Group)scene.getRoot();
root.getChildren().add(hbox);
stage.setScene(scene);
stage.show();
}
示例6: addStartTitledPane
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
protected void addStartTitledPane () {
TitledPane titledPane = new TitledPane();
titledPane.setText("Transition before choice (on start)");
titledPane.setAnimated(true);
// load fxml
try {
FXMLLoader loader = new FXMLLoader(new File(TRANSITION_PANE_FXML).toURI().toURL());
//set controller
TransitionPaneController controller = new TransitionPaneController(this.entry, 0);
this.controllerList.add(controller);
loader.setController(controller);
Pane rootPane = loader.load();//FXMLLoader.load(new File(fxmlPath).toURI().toURL());
//initialize tab controller
controller.init(stage, null, rootPane);
titledPane.setContent(rootPane);
titledPane.setExpanded(true);
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
accordion.getPanes().add(titledPane);
}
示例7: addChoiceTitledPane
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
protected void addChoiceTitledPane (int index) {
TitledPane titledPane = new TitledPane();
titledPane.setText("Choice " + index);
titledPane.setAnimated(true);
// load fxml
try {
FXMLLoader loader = new FXMLLoader(new File(TRANSITION_PANE_FXML).toURI().toURL());
//set controller
TransitionPaneController controller = new TransitionPaneController(this.entry, index);
this.controllerList.add(controller);
loader.setController(controller);
Pane rootPane = loader.load();//FXMLLoader.load(new File(fxmlPath).toURI().toURL());
//initialize tab controller
controller.init(stage, null, rootPane);
titledPane.setContent(rootPane);
titledPane.setExpanded(true);
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
accordion.getPanes().add(titledPane);
}
示例8: makeLists
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
private Node makeLists() {
Accordion lists = new Accordion();
TitledPane games = new TitledPane();
games.setText(databaseProperties.getString("Games"));
ListView<String> actualGames = new ListView<>();
List<String> authoredGames = database.getStatsbyUser(user.getProperty(VoogaUser.USER_NAME).toString()).stream()
.map(e -> e.getProperty(StatCell.MY_GAME).toString()).collect(Collectors.toList());
actualGames.getItems().setAll(authoredGames);
actualGames.setOnMouseClicked(e -> clickList(actualGames.getSelectionModel().getSelectedItem()));
games.setContent(actualGames);
lists.getPanes().addAll(games);
lists.setPrefWidth(DATA_WIDTH * ACCORDION_SIZE_FACTOR);
return lists;
}
示例9: populateTiles
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
private TitledPane populateTiles(String name) throws VoogaException {
TitledPane tile = createTile();
tile.setText(name);
tile.setOnMouseClicked((MouseEvent e) -> {
if (e.getButton() == MouseButton.SECONDARY) {
tiles.remove(tile);
accordion.getPanes().remove(tile);
}
});
accordion.getPanes().add(tile);
return tile;
}
示例10: onActionIncreaseProjectCounter
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
private void onActionIncreaseProjectCounter(TitledPane titledPane, String projectName) {
LoggerFacade.INSTANCE.debug(this.getClass(), "On action increase Project counter"); // NOI18N
final String title = titledPane.getText();
final String counted = title.substring(1, title.indexOf(')')); // NOI18N
final int counter = Integer.parseInt(counted) + 1;
titledPane.setText("(" + counter + ") " + projectName); // NOI18N
LoggerFacade.INSTANCE.trace(this.getClass(), "TODO update database with the new counter"); // NOI18N
this.onActionEnsureTitledPaneIsVisible(titledPane);
}
示例11: 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;
}
示例12: start
import javafx.scene.control.TitledPane; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
stage.setTitle("TitledPane");
Scene scene = new Scene(new Group(), 800, 250);
scene.setFill(Color.GHOSTWHITE);
// --- GridPane container
TitledPane gridTitlePane = new TitledPane();
GridPane grid = new GridPane();
grid.setVgap(4);
grid.setPadding(new Insets(5, 5, 5, 5));
grid.add(new Label("To: "), 0, 0);
grid.add(new TextField(), 1, 0);
grid.add(new Label("Cc: "), 0, 1);
grid.add(new TextField(), 1, 1);
grid.add(new Label("Subject: "), 0, 2);
grid.add(new TextField(), 1, 2);
grid.add(new Label("Attachment: "), 0, 3);
grid.add(label, 1, 3);
gridTitlePane.setText("Grid");
gridTitlePane.setContent(grid);
// --- Accordion
final Accordion accordion = new Accordion();
for (int i = 0; i < imageNames.length; i++) {
images[i] = new Image(getClass().getResourceAsStream(imageNames[i] + ".jpg"));
pics[i] = new ImageView(images[i]);
tps[i] = new TitledPane(imageNames[i], pics[i]);
}
accordion.getPanes().addAll(tps);
accordion.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {
@Override
public void changed(ObservableValue<? extends TitledPane> arg0, TitledPane arg1, TitledPane arg2) {
// TODO Auto-generated method stub
}/*
public void changed(ObservableValue<? extends TitledPane> ov, TitledPane old_val, TitledPane new_val) {
if (new_val != null) {
label.setText(accordion.getExpandedPane().getText() + ".jpg");
}
}
*/});
HBox hbox = new HBox(10);
hbox.setPadding(new Insets(20, 0, 0, 20));
hbox.getChildren().setAll(gridTitlePane, accordion);
Group root = (Group) scene.getRoot();
root.getChildren().add(hbox);
stage.setScene(scene);
stage.show();
}
示例13: 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;
}
示例14: 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;
}