当前位置: 首页 > news >正文

济南市网站建设网店装修论文

济南市网站建设,网店装修论文,免费做产品宣传的网站,1g内存跑wordpressVBox布局将子节点堆叠在垂直列中。新添加的子节点被放置在上一个子节点的下面。默认情况下,VBox尊重子节点的首选宽度和高度。 当父节点不可调整大小时,例如Group节点,最大垂直列的宽度基于具有最大优选宽度的节点。 默认情况下,…

VBox布局将子节点堆叠在垂直列中。新添加的子节点被放置在上一个子节点的下面。默认情况下,VBox尊重子节点的首选宽度和高度。

当父节点不可调整大小时,例如Group节点,最大垂直列的宽度基于具有最大优选宽度的节点。
默认情况下,每个子节点与左上(Pos.TOP_LEFT)位置对齐。

示例

以下代码将TextArea控件设置为在调整父VBox的高度时垂直增长:

TextArea  myTextArea = new TextArea();
//设置后跟随外边框增长
VBox.setHgrow(myTextArea,  Priority.ALWAYS);

完整的代码如下所示

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;public class Main extends Application {@Overridepublic void start(Stage primaryStage) {TextArea myTextArea = new TextArea();VBox hbox = new VBox();hbox.getChildren().add(myTextArea);//设置以后跟随外边框增长VBox.setVgrow(myTextArea, Priority.ALWAYS);Scene scene = new Scene(hbox, 320, 112, Color.rgb(0, 0, 0, 0));primaryStage.setScene(scene);primaryStage.show();}public static void main(String[] args) {launch(args);}
}

示例

下面的代码使用四个矩形来演示VBox的使用。

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;public class Main extends Application {@Overridepublic void start(Stage primaryStage) {Group root = new Group();Scene scene = new Scene(root, 300, 250);// 5 pixels space between child nodesVBox vbox = new VBox(5);// 1 pixel padding between child nodes onlyvbox.setPadding(new Insets(1));Rectangle r1 = new Rectangle(10, 10);Rectangle r2 = new Rectangle(20, 100);Rectangle r3 = new Rectangle(50, 20);Rectangle r4 = new Rectangle(20, 50);VBox.setMargin(r1, new Insets(2, 2, 2, 2));vbox.getChildren().addAll(r1, r2, r3, r4);root.getChildren().add(vbox);primaryStage.setScene(scene);primaryStage.show();}public static void main(String[] args) {launch(args);}
}

VBox间距

VBox vbox = new VBox(8); // spacing = 8
vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste"));

完整的实现代码如下所示

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;public class Main extends Application {@Overridepublic void start(final Stage stage) {stage.setTitle("HTML");stage.setWidth(500);stage.setHeight(500);Scene scene = new Scene(new Group());VBox vbox = new VBox(8); // spacing = 8vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste"));scene.setRoot(vbox);stage.setScene(scene);stage.show();}public static void main(String[] args) {launch(args);}
}

设置填充和间距

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.stage.Stage;public class Main extends Application {public static void main(String[] args) {Application.launch(args);}@Overridepublic void start(Stage primaryStage) {primaryStage.setTitle("VBox Test");// VBoxVBox vb = new VBox();vb.setPadding(new Insets(10, 50, 50, 50));vb.setSpacing(10);Label lbl = new Label("VBox");lbl.setFont(Font.font("Amble CN", FontWeight.BOLD, 24));vb.getChildren().add(lbl);// ButtonsButton btn1 = new Button();btn1.setText("Button1");vb.getChildren().add(btn1);Button btn2 = new Button();btn2.setText("Button2");vb.getChildren().add(btn2);Button btn3 = new Button();btn3.setText("Button3");vb.getChildren().add(btn3);Button btn4 = new Button();btn4.setText("Button4");vb.getChildren().add(btn4);// Adding VBox to the sceneScene scene = new Scene(vb);primaryStage.setScene(scene);primaryStage.show();}
}

http://www.yayakq.cn/news/329259/

相关文章:

  • 做网站算经商吗房屋设计风格
  • 网站建设方案论文wordpress 主题教程电子书
  • 如何规避电子政务门户网站建设下了网站建设
  • 黄岛网站建设服务能否提供代码 网站建设
  • 淄博企业网站建设哪家专业如何建设网站步骤
  • 网站推广优化趋势湖北做网站价格
  • 学校网站模板 dedecms营销网站费用
  • 网站开发的难点与重点微信小程序定制团队
  • 昭平县建设局网站电子商务网站制作步骤
  • 哪个网站有适合小学生做的题乡下自家院子设计图片
  • 建设网站公司排名网页生成应用
  • php网站建设论文wordpress 页面添加图标
  • 电子线路板东莞网站建设为什么网站不需要icp备案
  • 公司英文网站多少钱乐清企业网站制作
  • 东莞建站网站建设产品推广个人可以做微信小程序吗?
  • 怎样开通网站wordpress nas 外网
  • 网站有哪些分类wordpress电影下载站
  • 手机备案网站大连甘井子区租房
  • 网站层次索引模板ui设计介绍
  • 合肥seo网站多少钱推广方案有哪些
  • 大连百度做网站推广电话装修公司网站该怎么做
  • 有专门做辩论的网站吗顺德网站建设公司
  • 精通网站建设 pdf用软件建网站
  • 做网站后台要做些什么毕设做网站具体步骤
  • 学而思的网站哪里做的如何改wordpress主页
  • 网站的动效怎么做的互动网站策划
  • 中国优秀的企业网站青岛知名网站建设公司
  • 宿州市埇桥建设规划局网站静态页面生成系统
  • 手机单页网站证件查询官网入口
  • anaconda可以做网站吗零基础怎么学网页设计