Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8113789

Particular values of -fx-border-color may curtain off -fx-border-style

XMLWordPrintable


      Particular values of -fx-border-color may curtain off -fx-border-style

      (JavaFX 2.0 bet b35 + JDK 1.6.0_25 + WinXP SP3)

      The problem is:

      Below works fine as I expected

      vbox.setStyle("-fx-border-insets: -10 -20 -20 -10, -30; -fx-border-color: red blue yellow green, blue; -fx-border-style: dotted solid dotted solid, dotted;");

      but if I changed it to below(only the colors changed), all the 4 "inner" borders magically become the same dotted

      vbox.setStyle("-fx-border-insets: -10 -20 -20 -10, -30; -fx-border-color: blue blue blue blue, yellow; -fx-border-style: dotted solid dotted solid, dotted;");

      Complete codes below for re-producing

      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.layout.VBox;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Circle;
      import javafx.stage.Stage;

      /**
       *
       * @author lianqi.li
       */
      public class CSSBorderStyleIssue extends Application {
          @Override public void start(Stage stage) {
              final Group root = new Group();
              final Scene scene = new Scene(root, 800, 600);

              final Circle circle = new Circle(50);
              circle.setFill(Color.AQUA);
             
              final VBox vbox = new VBox(10) ;
              vbox.getChildren().addAll(circle);
              vbox.setLayoutX(300);
              vbox.setLayoutY(150);

              // Below css style works as expected
              vbox.setStyle("-fx-border-insets: -10 -20 -20 -10, -30; -fx-border-color: red blue yellow green, blue; -fx-border-style: dotted solid dotted solid, dotted;");
             
              // Below css style does NOT work as expected
              // Commen out the above vbox.setStyle(...) and then
              // uncomment below line to re-produce
              // vbox.setStyle("-fx-border-insets: -10 -20 -20 -10, -30; -fx-border-color: blue blue blue blue, yellow; -fx-border-style: dotted solid dotted solid, dotted;");
             
              root.getChildren().addAll(vbox);

              stage.setScene(scene);
              stage.setVisible(true);
          }

          public static void main(String[] args) {
              Application.launch(CSSBorderStyleIssue.class, args);
          }
      }

            jandrese Joe Andresen (Inactive)
            lianqli Lianqi Li (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: