本文整理汇总了Java中javafx.scene.layout.HBox.setMinHeight方法的典型用法代码示例。如果您正苦于以下问题:Java HBox.setMinHeight方法的具体用法?Java HBox.setMinHeight怎么用?Java HBox.setMinHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.HBox
的用法示例。
在下文中一共展示了HBox.setMinHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NotificationBarPane
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public NotificationBarPane(Node content) {
super(content);
progressBar = new ProgressBar();
label = new Label("infobar!");
bar = new HBox(label);
bar.setMinHeight(0.0);
bar.getStyleClass().add("info-bar");
bar.setFillHeight(true);
setBottom(bar);
// Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
sceneProperty().addListener(o -> {
if (getParent() == null) return;
getParent().applyCss();
getParent().layout();
barHeight = bar.getHeight();
bar.setPrefHeight(0.0);
});
items = FXCollections.observableArrayList();
items.addListener((ListChangeListener<? super Item>) change -> {
config();
showOrHide();
});
}
示例2: createHorizontalBox
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public static HBox createHorizontalBox(double width, double height)
{
HBox box = new HBox();
box.setMinWidth(width);
box.setMaxWidth(width);
box.setMinHeight(height);
box.setMaxHeight(height);
return box;
}
示例3: homeView
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public static Scene homeView(){
BorderPane view = new BorderPane();
Label title = new Label("Classroom Flipkart");
title.setFont(new Font("Open Sans", 60));
title.setTextFill(Color.web("#ededed"));
HBox header = new HBox(25);
header.setMinHeight(30);
header.setAlignment(Pos.TOP_CENTER);
Label login = new Label("Login");
login.setPadding(new Insets(5));
login.setFont(new Font("Open Sans", 20));
login.setTextFill(Color.web("#ededed"));
login.setCursor(Cursor.HAND);
login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
Label register = new Label("Register");
register.setPadding(new Insets(5));
register.setFont(new Font("Open Sans", 20));
register.setTextFill(Color.web("#ededed"));
register.setCursor(Cursor.HAND);
header.getChildren().addAll(login, register);
userLogin loginObject = new userLogin();
userSignUp signUpObject = new userSignUp();
BorderPane credential = new BorderPane(loginObject.userLogin(), header, null, null, null);
credential.setMaxWidth(350);
credential.setStyle("-fx-background-color: rgba(0, 100, 100, 0.5); -fx-border-color: grey; -fx-border-width: 1 1 1 1;");
login.setOnMouseClicked(e->{
credential.setCenter(loginObject.userLogin());
login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
register.setStyle("");
});
register.setOnMouseClicked(e->{
credential.setCenter(signUpObject.userSignUp());
login.setStyle("");
register.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
});
VBox centerVB = new VBox(30);
centerVB.setAlignment(Pos.CENTER);
centerVB.getChildren().addAll(title, credential);
view.setCenter(centerVB);
Scene scene = new Scene(view,800,500);
scene.getStylesheets().add(loginHome.class.getResource("../../resources/css/main.css").toExternalForm());
image = loginHome.class.getResource("../../resources/images/splash.jpg").toExternalForm();
view.setStyle("-fx-background-image: url('" + image + "'); " +
"-fx-background-position: center center; " +
"-fx-background-size: cover, auto; " +
"-fx-background-repeat: stretch;");
return scene;
}
示例4: updateEditedCell
import javafx.scene.layout.HBox; //导入方法依赖的package包/类
/**
* Update an edited cell.
*
* @param cell the edited cell.
*/
@FXThread
public static void updateEditedCell(final Labeled cell) {
final javafx.scene.Node graphic = cell.getGraphic();
if (graphic instanceof HBox) {
final HBox hbox = (HBox) graphic;
hbox.setAlignment(Pos.CENTER_LEFT);
hbox.setMinHeight(cell.getMinHeight());
} else if (graphic instanceof Control) {
}
}