private void initStyle(StackPane pane) { pane.setOpacity(1); pane.setPrefSize(30, 4); pane.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(5), Insets.EMPTY))); }
private void init() { setClip(clip); clip.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(2), Insets.EMPTY))); backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(getBackground(), clip)); }
private void initialize() { this.setVisible(false); this.getStyleClass().add(DEFAULT_STYLE_CLASS); this.transitionType.addListener((o, oldVal, newVal) -> { animation = getShowAnimation(transitionType.get()); }); contentHolder = new StackPane(); contentHolder.setBackground(new Background(new BackgroundFill(Color.WHITE, new CornerRadii(2), null))); JFXDepthManager.setDepth(contentHolder, 4); contentHolder.setPickOnBounds(false); // ensure stackpane is never resized beyond it's preferred size contentHolder.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.getChildren().add(contentHolder); this.getStyleClass().add("jfx-dialog-overlay-pane"); StackPane.setAlignment(contentHolder, Pos.CENTER); this.setBackground(new Background(new BackgroundFill(Color.rgb(0, 0, 0, 0.1), null, null))); // close the dialog if clicked on the overlay pane if (overlayClose.get()) { this.addEventHandler(MouseEvent.MOUSE_PRESSED, closeHandler); } // prevent propagating the events to overlay pane contentHolder.addEventHandler(MouseEvent.ANY, e -> e.consume()); }
backMonthButton.setMinSize(40, 40); backMonthButton.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, new CornerRadii(40), Insets.EMPTY))); backMonthButton.getStyleClass().add("left-button"); forwardMonthButton.setMinSize(40, 40); forwardMonthButton.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, new CornerRadii(40), Insets.EMPTY))); forwardMonthButton.getStyleClass().add("right-button");
box.setBorder(new Border(new BorderStroke(control.getUnCheckedColor(), BorderStrokeStyle.SOLID, new CornerRadii(0), new BorderWidths(lineThick))));
dayCell.setBackground( new Background(new BackgroundFill(this.datePicker.getDefaultColor(), new CornerRadii(40), Insets.EMPTY)));
if (!dayCell.getStyleClass().contains("selected")) { dayCell.setBackground(new Background(new BackgroundFill(Color.valueOf("#EDEDED"), new CornerRadii(40), Insets.EMPTY)));
new CornerRadii(2), new BorderWidths(2))));
.getFills() .get(0) .getRadii() : new CornerRadii( 3), colorBox.backgroundProperty()
BackgroundFill myBF = new BackgroundFill(Color.BLUEVIOLET, new CornerRadii(1), new Insets(0.0,0.0,0.0,0.0));// or null for the padding //then you set to your node or container or layout myContainer.setBackground(new Background(myBF));
clip.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(3), Insets.EMPTY))); backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(getBackground(), clip));
box.setBorder(new Border(new BorderStroke(control.getUnCheckedColor(), BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(2)))); box.getChildren().setAll(indeterminateMark, mark);
@Override public void run() { Pane contents = new Pane(); contents.setBackground(new Background( new BackgroundFill(jfxColour, new CornerRadii(0), new Insets(0)))); // Scene scene = new Scene(contents); Scene scene = new Scene(contents, javafx.scene.paint.Color.BLACK); // !!!!!!!! jfxPanel.setScene(scene); }
ObservableList<String> myChoices = FXCollections.observableArrayList(); void testComboBoxCheck(VBox box) { myChoices.add("A"); myChoices.add("B"); myChoices.add("C"); ComboBox<String> first = new ComboBox<String>(); first.setItems(myChoices); first.setEditable(true); first.editorProperty().getValue().textProperty().addListener((v, o, n) -> { if (myChoices.contains(n.toUpperCase())) { first.setBackground(new Background(new BackgroundFill(Color.rgb(30,30,30), new CornerRadii(0), new Insets(0)))); } else { first.setBackground(new Background(new BackgroundFill(Color.RED, new CornerRadii(0), new Insets(0)))); } }); box.getChildren().addAll(first); }
@Override public void run() { Pane contents = new Pane(); contents.setBackground(new Background( new BackgroundFill(jfxColour, new CornerRadii(0), new Insets(0)))); Scene scene = new Scene(contents); jfxPanel.setScene(scene); }
private void initStyle(StackPane pane) { pane.setOpacity(1); pane.setPrefSize(30, 4); pane.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(5), Insets.EMPTY))); }
private void update() { this.setBorder( new Border( new BorderStroke( this.borderColor, BorderStrokeStyle.SOLID, new CornerRadii( 30 ), new BorderWidths( 1.25 ), null ) ) ); this.setBackground( new Background( new BackgroundFill( this.backgroundColor, new CornerRadii( 30 ), null ) ) ); this.setPadding( new Insets( 10, 15, 10, 15 ) ); this.setTextFill( this.foregroundColor ); }
private void init() { setClip(clip); clip.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(2), Insets.EMPTY))); backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(getBackground(), clip)); }
@Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { StackPane bar = ((StackPane) getSkinnable().lookup(".bar")); int start = 1 - (int) ((38 * bar.getHeight() / 20) * newValue.doubleValue()); String imageString= determinateImageProperty().get(); if(imageString == null){ imageString= "progress.png"; } Image image = new Image(AquaFx.class.getResource("controls/skin/"+imageString).toExternalForm()); ImagePattern pattern = new ImagePattern(image, start, 0, (38 * bar.getHeight() / 20), bar.getHeight(), false); BackgroundFill backkgroudFill = new BackgroundFill(pattern, new CornerRadii(0), new Insets(0)); bar.setBackground(new Background(backkgroudFill)); } });
Pane testImage2(Pane pane) { Pane inner = new Pane(); inner.prefWidthProperty().bind(pane.widthProperty()); inner.prefHeightProperty().bind(pane.heightProperty()); pane.getChildren().add(inner); SVGPath texture = new SVGPath(); texture.setStroke(Color.GREEN); texture.setStrokeWidth(2.5); texture.setFill(Color.TRANSPARENT); texture.setContent("M 10 10 C 40 10 10 70 70 20"); SnapshotParameters params = new SnapshotParameters(); params.setViewport(new Rectangle2D(-5, -5, 70, 50)); Image image = texture.snapshot(params, null); Paint paint = new ImagePattern(image, 5,5, 20, 20, false); inner.setBackground(new Background(new BackgroundFill(paint, new CornerRadii(0), new Insets(inset)))); return pane; }