當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。