本文整理匯總了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();
}