JavaFX Mitered Border Effect | بلاگ

JavaFX Mitered Border Effect

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

What are my options to make my borders render similar to the below photo. I'm fairly new to styling with JavaFX but I feel comfortable using the API as well as JavaFX CSS. Example of desired border mitering

import javafx.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.stage.*;

public class Foobar extends Application {
  public void start(Stage stage) {
    // Just setup to create a sane testing ground
    HBox hbox = new HBox();
    Region region = new Region();
      "-fx-pref-width: 350px;" +
      "-fx-pref-height: 200px;"

    // Add a border style to the hbox
      "-fx-border-color: black blue black blue;" +
      "-fx-border-width: 16px;" +
      "-fx-border-radius: 0px;" +
      "-fx-border-insets: 0px;" +
      "-fx-border-style: solid;"

    // Show the stage
    VBox root = new VBox();
    root.setStyle("-fx-background-color: silver");
    Scene scene = new Scene(root);

Program output

asked 46 secs ago

نویسنده : استخدام کار بازدید : 10 تاريخ : شنبه 11 فروردين 1397 ساعت: 10:05