当前位置: 首页>>代码示例>>Java>>正文


Java VBox.setMinSize方法代码示例

本文整理汇总了Java中javafx.scene.layout.VBox.setMinSize方法的典型用法代码示例。如果您正苦于以下问题:Java VBox.setMinSize方法的具体用法?Java VBox.setMinSize怎么用?Java VBox.setMinSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.VBox的用法示例。


在下文中一共展示了VBox.setMinSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
    public void start(Stage stage) throws Exception {
        VBox root = new VBox();
        Label label = new Label("");
// Turn Observable into Binding
        Binding<String> binding =
                Observable.interval(1, TimeUnit.SECONDS)
                        .map(i -> i.toString())
                        .observeOn(JavaFxScheduler.platform())
                        .to(JavaFxObserver::toBinding);
//Bind Label to Binding
        label.textProperty().bind(binding);
        root.setMinSize(200, 100);
        root.getChildren().addAll(label);
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.show();
    }
 
开发者ID:PacktPublishing,项目名称:Learning-RxJava,代码行数:19,代码来源:Ch9_6.java

示例2: start

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
    public void start(Stage stage) throws Exception {
        VBox root = new VBox();
        Label label = new Label("");
// Observable with second timer
        Observable<String> seconds =
                Observable.interval(1, TimeUnit.SECONDS)
                        .map(i -> i.toString())
                        .observeOn(JavaFxScheduler.platform());
// Turn Observable into Binding
        Binding<String> binding =
                JavaFxObserver.toBinding(seconds);
//Bind Label to Binding
        label.textProperty().bind(binding);
        root.setMinSize(200, 100);
        root.getChildren().addAll(label);
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.show();
    }
 
开发者ID:PacktPublishing,项目名称:Learning-RxJava,代码行数:21,代码来源:Ch9_5.java

示例3: start

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
    public void start(Stage stage) throws Exception {
        VBox root = new VBox();
        root.setMinSize(200, 100);
        Label typedTextLabel = new Label("");
        root.getChildren().addAll(typedTextLabel);
        Scene scene = new Scene(root);
// Multicast typed keys
        Observable<String> typedLetters =
                JavaFxObservable.eventsOf(scene,
                        KeyEvent.KEY_TYPED)
                        .map(KeyEvent::getCharacter)
                        .share();
// Signal 300 milliseconds of inactivity
        Observable<String> restSignal =
                typedLetters
                        .throttleWithTimeout(500,
                                TimeUnit.MILLISECONDS)
                        .startWith(""); //trigger initial
// switchMap() each period of inactivity to
// an infinite scan() concatenating typed letters
        restSignal.switchMap(s ->
                typedLetters.scan("", (rolling, next) -> rolling +
                        next)
        ).observeOn(JavaFxScheduler.platform())
                .subscribe(s -> {
                    typedTextLabel.setText(s);
                    System.out.println(s);
                });
        stage.setScene(scene);
        stage.show();
    }
 
开发者ID:PacktPublishing,项目名称:Learning-RxJava,代码行数:33,代码来源:Ch7_17.java

示例4: makeVBox

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
public VBox makeVBox (double spacing,
                      Pos alignment,
                      double width,
                      double height,
                      Node ... content) {
    VBox box = makeVBox(spacing, alignment, content);
    box.setMinSize(width, height);
    return box;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:10,代码来源:BasicUIFactory.java

示例5: start

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    Parent pane = root.get();

    double width = size.width;
    double height = size.height;

    VBox box = new VBox(pane);
    VBox.setVgrow(pane, ALWAYS);
    box.setMinSize(width, height);
    box.setPrefSize(width, height);
    box.setMaxSize(width, height);

    box.setBackground(new Background(new BackgroundFill(fill, null, null)));

    ScrollPane scroll = new ScrollPane(box);
    Scene scene = new Scene(scroll);

    stage.setScene(scene);
    stage.show();
}
 
开发者ID:testing-av,项目名称:testing-video,代码行数:22,代码来源:FxDisplay.java


注:本文中的javafx.scene.layout.VBox.setMinSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。