javafx.scene.layout.VBox.setStyle()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中javafx.scene.layout.VBox.setStyle()方法的一些代码示例,展示了VBox.setStyle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.setStyle()方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:setStyle

VBox.setStyle介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

layout.setStyle("-fx-padding: 20px; -fx-background-color: silver");
layout.setAlignment(Pos.CENTER);
layout.getChildren().setAll(

代码示例来源:origin: stackoverflow.com

TreeView<String> notes = new TreeView<>(root);
optionPane.getChildren().addAll(menuBar, new Label("Kaiser Notes"), notes);
optionPane.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
TextField textField = new TextField();
editorBox.getChildren().addAll(textField, editor);
editorBox.setStyle("-fx-background-color: mistyrose; -fx-padding: 10;");
editor.setHtmlText(getSampleText());

代码示例来源:origin: jfoenixadmin/JFoenix

@Override
public void start(Stage stage) throws Exception {
  final VBox pane = new VBox();
  pane.setSpacing(30);
  pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
  ToggleButton button = new ToggleButton("JavaFx Toggle");
  pane.getChildren().add(button);
  JFXToggleButton toggleButton = new JFXToggleButton();
  toggleButton.setText("New Skin");
  pane.getChildren().add(toggleButton);
  JFXToggleNode node = new JFXToggleNode();
  final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class)
    .glyph(FontAwesomeIcon.HEART)
    .build();
  heartIcon.setStyle("-fx-padding: 10");
  node.setGraphic(heartIcon);
  pane.getChildren().add(node);
  final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
  stage.setTitle("JFX Toggle Button Demo ");
  scene.getStylesheets()
    .add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
  stage.setScene(scene);
  stage.setResizable(false);
  stage.show();
}

代码示例来源:origin: stackoverflow.com

layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(button, response);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");
stage.setScene(new Scene(layout));

代码示例来源:origin: jfoenixadmin/JFoenix

pane.setStyle("-fx-background-color:WHITE;-fx-padding:40;");

代码示例来源:origin: stackoverflow.com

layout.setStyle("-fx-padding: 10;");
layout.getChildren().addAll(configure, update);
stage.setScene(new Scene(layout));

代码示例来源:origin: jfoenixadmin/JFoenix

pane.setStyle("-fx-background-color:WHITE");

代码示例来源:origin: stackoverflow.com

layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;");
layout.getChildren().setAll(
 monitored,

代码示例来源:origin: stackoverflow.com

layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(button, response);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10; -fx-font-size: 20;");
stage.setScene(new Scene(layout));
stage.show();

代码示例来源:origin: stackoverflow.com

@Override public void start(Stage stage) throws Exception {
 final VBox messages = new VBox();
 messages.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
 messages.getChildren().add(sequentialProgressSummary);
 messages.setStyle("-fx-font-family: monospace;");

代码示例来源:origin: stackoverflow.com

layout.getChildren().addAll(countdownLabel, countdownButton);
layout.setAlignment(Pos.BASELINE_RIGHT);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-demoapp-components

/**
 * Constructor
 */
public DemoDialogController() {
 super();
 pane.setStyle("-fx-alignment:TOP_CENTER;-fx-padding:64;-fx-spacing:64");
}

代码示例来源:origin: stackoverflow.com

table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
VBox layout = new VBox(10);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
layout.getChildren().setAll(
    currentObjectValue,

代码示例来源:origin: stackoverflow.com

);
layout.setAlignment(Pos.CENTER);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;");
stage.setScene(new Scene(layout, 200, 130));
stage.show();

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 super.buildFrom(controller, configuration);
 pane.setStyle("-fx-border-width: 1 1 1 4;" + "-fx-min-height: 200;" + "-fx-spacing:16;" + "-fx-padding: 16;" + "-fx-alignment: TOP_LEFT;"
   + "-fx-border-color: -grey-color-200 -grey-color-200 -grey-color-200 -accent-color;" + "-fx-background-color: #f1f1f1;");
}

代码示例来源:origin: stackoverflow.com

String cssLayout = "-fx-border-color: red;\n" +
          "-fx-border-insets: 5;\n" +
          "-fx-border-width: 3;\n" +
          "-fx-border-style: dashed;\n";

VBox yourBox = new VBox();   
yourBox.setStyle(cssLayout);

代码示例来源:origin: stackoverflow.com

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;

public class SliderCss extends Application {
 public static void main(String[] args) { launch(args); }
 @Override public void start(Stage stage) throws Exception {
  VBox layout = new VBox();
  layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;");
  layout.getChildren().setAll(new Slider());
  layout.getStylesheets().add(getClass().getResource("slider.css").toExternalForm());
  stage.setScene(new Scene(layout));

  stage.show();
 }
}

代码示例来源:origin: org.copper-engine/copper-monitoring-client

private void createLegend() {
  VBox pane = new VBox();
  // pane.setScaleX(0.5);
  // pane.setScaleY(0.5);
  pane.getChildren().add(new Label("Legend"));
  pane.getChildren().add(createLegendEntry("adapter", AdapterAnimation.ADAPTER_COLOR));
  pane.getChildren().add(createLegendEntry("adapter method call", CallAnimation.ADAPTER_CALL_COLOR));
  pane.getChildren().add(createLegendEntry("notify correlation id ", NotifyAnimation.ADAPTER_NOTIFY_COLOR));
  pane.getChildren().add(createLegendEntry("workflow launch", LaunchAnimation.ADAPTER_LAUNCH_COLOR));
  pane.getChildren().add(createLegendEntry("workflow instance", WorkflowAnimation.WORKFLOW_COLOR));
  pane.setStyle("-fx-border-color: black; -fx-border-width: 1;");
  pane.setTranslateX(3);
  pane.setTranslateY(animationPane.getHeight() - 150);
  animationPane.getChildren().add(pane);
}

代码示例来源:origin: stackoverflow.com

private VBox Chat(){

  VBox chat = new VBox();
  chat.setPrefSize(400, 400);
  chat.setStyle("-fx-background-color:#333333;");

  Label txt1 = new Label("Text1");
  txt1.setTextFill(Color.WHITE); 
  txt1.setPrefWidth(400); 
  txt1.setAlignment(Pos.CENTER_LEFT);

  Label txt2 = new Label("Text2");
  txt2.setTextFill(Color.WHITE); 
  txt2.setPrefWidth(400); 
  txt2.setAlignment(Pos.CENTER_RIGHT);  

  chat.getChildren().addAll(txt1,txt2);

  return chat;
}

代码示例来源:origin: stackoverflow.com

@Override
public void start(Stage primaryStage) {
  Button btn = new Button();
  btn.setText("Play by resizing the window");
  VBox root = new VBox();
  root.getChildren().add(btn);
  root.setStyle("-fx-background-color: gray");

  Scene scene = new Scene(root);
  primaryStage.setScene(scene);
  primaryStage.minWidthProperty().bind(scene.heightProperty().multiply(2));
  primaryStage.minHeightProperty().bind(scene.widthProperty().divide(2));
  primaryStage.show();
}

相关文章