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

x33g5p2x  于2022-01-16 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(94)

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

BorderPane.setStyle介绍

暂无

代码示例

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

BorderPane root = new BorderPane();  
root.setStyle("-fx-background-color: transparent;");  

Scene scene = new Scene(root, 600, 400, Color.BLACK);

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

public class MainApp extends Application {
   @Override
   public void start(Stage stage) throws Exception {
     BorderPane bp = new BorderPane();
     bp.setPrefSize(600, 600);
     bp.setMaxSize(600, 600);
     bp.setStyle("-fx-background-color: #2f4f4f;");
     VBox vb = new VBox(bp);
     ScrollPane scrollPane = new ScrollPane(vb);
     //scrollPane.setFitToHeight(true);
     //scrollPane.setFitToWidth(true);
     scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
     scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
     Scene scene = new Scene(scrollPane);
     stage.setScene(scene);
     stage.show();
   }
   public static void main(String[] args) {
     launch(args);
   }
 }

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

private InternalWindow constructWindow() {
  // content
  ImageView imageView = new ImageView("https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Cheetah4.jpg/250px-Cheetah4.jpg");
  // title bar
  BorderPane titleBar = new BorderPane();
  titleBar.setStyle("-fx-background-color: green; -fx-padding: 3");
  Label label = new Label("header");
  titleBar.setLeft(label);
  Button closeButton = new Button("x");
  titleBar.setRight(closeButton);
  // title bat + content
  BorderPane windowPane = new BorderPane();
  windowPane.setStyle("-fx-border-width: 1; -fx-border-color: black");
  windowPane.setTop(titleBar);
  windowPane.setCenter(imageView);

  //apply layout to InternalWindow
  InternalWindow interalWindow = new InternalWindow();
  InternalWindow.setRoot(windowPane);
  //drag only by title
  interalWindow.makeDragable(titleBar);
  interalWindow.makeDragable(label);
  interalWindow.makeResizable(20);
  interalWindow.makeFocusable();
  return interalWindow;
}

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

label.setText(colortime.get("time"));
label.setStyle("-fx-text-fill: white");
pane.setStyle("-fx-background-color : " + colortime.get("color"));

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

public static Node createProgressIndicator() {
  ProgressIndicator indicator = new ProgressIndicator();
  indicator.setMaxHeight(350);
  indicator.setMaxWidth(350);
  BorderPane borderPane = new BorderPane();
  BorderPane.setMargin(indicator, new Insets(5));
  borderPane.setCenter(indicator);
  borderPane.setStyle("-fx-background-color: rgba(230,230,230,0.7);");
  return borderPane;
}

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

slider = new BorderPane();
slider.setPrefHeight(200);
mainPane.setStyle("-fx-background-color: chartreuse");
slider.setStyle("-fx-background-color: aqua");

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

borderPane.setTop(menubar);
borderPane.setLeft(listView);
borderPane.setStyle("-fx-background-color: palegreen;");

代码示例来源:origin: com.aquafx-project/aquafx

pane.setStyle("-fx-background-color: white;");
Scene scene = new Scene(pane);
AquaFx.style();

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

BorderPane rootNode = new BorderPane();
rootNode.setMinSize(300, 300);
rootNode.setStyle("-fx-background-color: RED;");
GridPane gridPane = new GridPane();
gridPane.setStyle("-fx-background-color: BLUE;");

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

root.setStyle("-fx-background-color: #efefef");
Group graph = new Group();
root.getChildren().add(graph);

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

root.setStyle("-fx-background-color: Black");
Pane graph = new Pane();
root.setCenter(graph);

代码示例来源:origin: com.aquafx-project/aquafx

pane.setStyle("-fx-background-color: white;");
Scene scene = new Scene(pane);
AquaFx.style();

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

root.setStyle("-fx-background-color:rgb(186,153,122,0.7); -fx-background-radius:30;");

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

root = new BorderPane();
root.setPrefSize(200, 200);
root.setStyle("-fx-border-width: 1; -fx-border-color: gray");
root.setTop(buildTitleBar());
setX(parent.getX() + 50);
pane.setStyle("-fx-background-color: burlywood; -fx-padding: 5");

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

/**
 * Prepare Stage for dock feedback display
 */
void buildDockFeedbackStage() {
 dockFeedbackPopup = new Stage(StageStyle.TRANSPARENT);
 dockFeedback = new Rectangle(0, 0, 100, 100);
 dockFeedback.setArcHeight(10);
 dockFeedback.setArcWidth(10);
 dockFeedback.setFill(Color.TRANSPARENT);
 dockFeedback.setStroke(Color.BLACK);
 dockFeedback.setStrokeWidth(2);
 dockFeedback.setCache(true);
 dockFeedback.setCacheHint(CacheHint.SPEED);
 dockFeedback.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 10, 0.2, 3, 3));
 dockFeedback.setMouseTransparent(true);
 BorderPane borderpane = new BorderPane();
 borderpane.setStyle("-fx-background-color:transparent"); // J8
 borderpane.setCenter(dockFeedback);
 Scene scene = new Scene(borderpane);
 scene.setFill(Color.TRANSPARENT);
 dockFeedbackPopup.setScene(scene);
 dockFeedbackPopup.sizeToScene();
}

代码示例来源:origin: com.aquafx-project/aquafx

pane.setStyle("-fx-background-color: white;");
Scene scene = new Scene(pane);
AquaFx.style();

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

tableLayout.setStyle("-fx-background-color:white");

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

border.setStyle("-fx-background-color:black");
border.setBottom(hbox);
border.setLeft(root);

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

top.setLeft(setBaseTitle());
top.setRight(setBaseButtons());
top.setStyle("-fx-border-width: 1;-fx-border-color: blue");

代码示例来源:origin: com.aquafx-project/aquafx

pane.setStyle("-fx-background-color: white;");
Scene scene = new Scene(pane);
primaryStage.setScene(scene);

相关文章