本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}