本文整理了Java中javafx.scene.layout.VBox.<init>()
方法的一些代码示例,展示了VBox.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.<init>()
方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
private VBox createStackedTitledPanes() {
final VBox stackedTitledPanes = new VBox();
stackedTitledPanes.getChildren().setAll(
new TitledPane("Pane 1", contentNode1),
new TitledPane("Pane 2", contentNode2),
new TitledPane("Pane 3", contentNode3)
);
((TitledPane) stackedTitledPanes.getChildren().get(0)).setExpanded(true);
return stackedTitledPanes;
}
代码示例来源:origin: stackoverflow.com
@Override
public void start(final Stage primaryStage) {
Button btn = new Button();
btn.setText("Open Dialog");
btn.setOnAction(
new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
final Stage dialog = new Stage();
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.initOwner(primaryStage);
VBox dialogVbox = new VBox(20);
dialogVbox.getChildren().add(new Text("This is a Dialog"));
Scene dialogScene = new Scene(dialogVbox, 300, 200);
dialog.setScene(dialogScene);
dialog.show();
}
});
}
代码示例来源:origin: stackoverflow.com
primaryStage.setTitle("Extension Filter Example");
final Label fileLabel = new Label();
Button btn = new Button("Open FileChooser");
btn.setOnAction(new EventHandler<ActionEvent>() {
VBox vBox = new VBox(30);
vBox.getChildren().addAll(fileLabel, btn);
vBox.setAlignment(Pos.BASELINE_CENTER);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
代码示例来源:origin: stackoverflow.com
final Label response = new Label();
final ImageView imageView = new ImageView(
new Image("http://icons.iconarchive.com/icons/gianni-polito/colobrush/128/software-emule-icon.png")
final VBox layout = new VBox(10);
layout.setPrefWidth(300);
layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(button, response);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");
stage.setScene(new Scene(layout));
代码示例来源:origin: stackoverflow.com
);
final Label currentRaceStage = new Label();
currentRaceStage.textProperty().bind(
taskMonitor.currentTaskNameProperty()
final Button startButton = new Button("Start Race");
startButton.disableProperty().bind(taskMonitor.idleProperty().not());
startButton.setOnAction(new EventHandler<ActionEvent>() {
final VBox layout = new VBox(10);
layout.getChildren().setAll(
raceProgress,
startButton
代码示例来源:origin: stackoverflow.com
private final Button runButton = new Button("Run");
private final Label label = new Label();
);
runButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
VBox layout = new VBox(10);
代码示例来源:origin: stackoverflow.com
VBox vboxForButtons = new VBox();
for(int i=0; i<10; i++){
Button btnNumber = new Button();
btnNumber.setText(String.valueOf(i));
btnNumber.setOnAction((ActionEvent)->{
System.out.println(btnNumber.getText());
});
vboxForButtons.getChildren().add(btnNumber);
}
代码示例来源:origin: jfoenixadmin/JFoenix
pane.setPadding(new Insets(18));
VBox container = new VBox();
container.getChildren().add(pane);
container.getChildren().add(tabs);
dialog.setScene(customScene);
final EventHandler<KeyEvent> keyEventListener = key -> {
switch (key.getCode()) {
代码示例来源:origin: stackoverflow.com
VBox buttonHolder = new VBox();
Button button = new Button(...);
buttonHolder.getChildren().add(button);
// repeat as necessary...
buttonHolder.setDisable(true); // all buttons in the VBox will now be disbaled
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void start(Stage stage) throws Exception {
final VBox pane = new VBox();
pane.setSpacing(30);
pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
ToggleButton button = new ToggleButton("JavaFx Toggle");
pane.getChildren().add(button);
JFXToggleButton toggleButton = new JFXToggleButton();
toggleButton.setText("New Skin");
pane.getChildren().add(toggleButton);
JFXToggleNode node = new JFXToggleNode();
final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class)
.glyph(FontAwesomeIcon.HEART)
.build();
heartIcon.setStyle("-fx-padding: 10");
node.setGraphic(heartIcon);
pane.getChildren().add(node);
final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
stage.setTitle("JFX Toggle Button Demo ");
scene.getStylesheets()
.add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
代码示例来源:origin: stackoverflow.com
public class SecondStage extends Stage {
Label x = new Label("Second stage");
VBox y = new VBox();
SecondStage(){
y.getChildren().add(x);
this.setScene(new Scene(y, 300, 300));
this.show();
}
}
代码示例来源:origin: stackoverflow.com
Button b = new Button();
VBox box = new VBox();
box.getChildren().addAll(new Label("line1"), new Label("line2"));
b.setGraphic(box);
代码示例来源:origin: stackoverflow.com
VBox vbox = new VBox();
vbox.getChildren().add(new MyComponent());
代码示例来源:origin: stackoverflow.com
primaryStage.setTitle("AnimationTest");
Pane pane = new Pane();
Rectangle rect = new Rectangle(0,0,100,100);
pane.getChildren().add(rect);
TranslateTransition transition =new TranslateTransition(Duration.millis(1000),rect);
transition.setByX(100);
Button button = new Button("StartAnimation");
button.setOnAction((e)->{
transition.play();
});
VBox layout = new VBox();
layout.getChildren().addAll(pane, button);
Scene scene = new Scene(layout, 600, 600);
primaryStage.setScene(scene);
primaryStage.show();
代码示例来源:origin: stackoverflow.com
VBox vBox = new VBox();
Button btn1 = new Button("Short");
Button btn2 = new Button("Super Long Button");
btn1.setMaxWidth(Double.MAX_VALUE);
btn2.setMaxWidth(Double.MAX_VALUE);
vBox.getChildren().addAll(btn1, btn2);
代码示例来源:origin: stackoverflow.com
VBox vb = new VBox();
Scene scene = new Scene( vb );
final Dialog dial = new Dialog( title, owner, scene, "res/Confirm.png" );
vb.setPadding( new Inset(10,10,10,10) );
vb.setSpacing( 10 );
Button yesButton = new Button( "Yes" );
yesButton.setOnAction( new EventHandler<ActionEvent>() {
@Override public void handle( ActionEvent e ) {
dial.close();
Button noButton = new Button( "No" );
noButton.setOnAction( new EventHandler<ActionEvent>() {
@Override public void handle( ActionEvent e ) {
dial.close();
VBox vb = new VBox();
Scene scene = new Scene( vb );
final Dialog dial = new Dialog( title, owner, scene, "res/Info.png" );
vb.setPadding( new Inset(10,10,10,10) );
vb.setSpacing( 10 );
Button okButton = new Button( "OK" );
okButton.setAlignment( Pos.CENTER );
okButton.setOnAction( new EventHandler<ActionEvent>() {
@Override public void handle( ActionEvent e ) {
dial.close();
代码示例来源:origin: stackoverflow.com
);
Label title = new Label("TRON");
title.getStyleClass().add("title");
Label caption = new Label("A sci-fi flick set in an alternate reality.");
caption.getStyleClass().add("caption");
caption.setMaxWidth(220);
caption.setTextAlignment(TextAlignment.CENTER);
VBox layout = new VBox(10);
layout.setStyle("-fx-padding: 20px; -fx-background-color: silver");
layout.setAlignment(Pos.CENTER);
layout.getChildren().setAll(
title,
new ImageView(
stage.setScene(scene);
stage.show();
代码示例来源:origin: stackoverflow.com
public class CustomGroup extends Group {
private VBox contentPane = new VBox();
public CustomGroup() {
getChildren().add(contentPane);
contentPane.getChildren().add(new Label("First Label"));
contentPane.getChildren().add(new Label("Second Label"));
}
public void setItems(Node...nodes) {
contentPane.getChildren().addAll(nodes);
}
public ObservableList<Node> getItems() {
return contentPane.getChildren();
}
}
代码示例来源:origin: stackoverflow.com
Label header = new Label("A Prideful Header");
header.getStyleClass().addAll("header");
Label footer = new Label("a humble footer");
footer.getStyleClass().addAll("footer");
VBox box = new VBox();
box.getChildren().addAll(header,footer);
Button button = new Button();
button.setGraphic(box);
代码示例来源:origin: jfoenixadmin/JFoenix
VBox headerPanel = new VBox();
headerPanel.getStyleClass().add("month-year-pane");
headerPanel.setBackground(new Background(new BackgroundFill(this.datePicker.getDefaultColor(),
Insets.EMPTY)));
headerPanel.setPadding(new Insets(12, 24, 12, 24));
headerPanel.getChildren().add(yearLabelContainer);
headerPanel.getChildren().add(selectedDateContainer);
return headerPanel;
内容来源于网络,如有侵权,请联系作者删除!