layout.setStyle("-fx-padding: 20px; -fx-background-color: silver"); layout.setAlignment(Pos.CENTER); layout.getChildren().setAll(
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());
@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(); }
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));
pane.setStyle("-fx-background-color:WHITE;-fx-padding:40;");
layout.setStyle("-fx-padding: 10;"); layout.getChildren().addAll(configure, update); stage.setScene(new Scene(layout));
pane.setStyle("-fx-background-color:WHITE");
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;"); layout.getChildren().setAll( monitored,
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();
layout.getChildren().addAll(countdownLabel, countdownButton); layout.setAlignment(Pos.BASELINE_RIGHT); layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 20; -fx-font-size: 20;");
/** * Constructor */ public DemoDialogController() { super(); pane.setStyle("-fx-alignment:TOP_CENTER;-fx-padding:64;-fx-spacing:64"); }
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); VBox layout = new VBox(10); layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;"); layout.getChildren().setAll( currentObjectValue,
); layout.setAlignment(Pos.CENTER); layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;"); stage.setScene(new Scene(layout, 200, 130)); stage.show();
/** * @{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;"); }
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);
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(); } }
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); }
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; }
@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(); }