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

[Dialogs] Alert with CSS border width is not displayed properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u60
    • 8u40
    • javafx
    • Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b20)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b23, mixed mode)
      Windows 7

    Description

      Run the sample application:

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.scene.Scene;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class IncorrectBorderBug extends Application {
          
          @Override
          public void start(Stage primaryStage) {
              Button btn = new Button();
              btn.setText("Show Alert !!");
              btn.setOnAction((ActionEvent event) -> {
                  Alert alert = new Alert(Alert.AlertType.ERROR);
                  alert.setContentText("Content");
                  alert.initOwner(primaryStage);
                  alert.getDialogPane().setStyle("-fx-border-color: black; -fx-border-width: 5; -fx-border-radius: 10;");
                  alert.show();
              });
              
              StackPane root = new StackPane();
              root.getChildren().add(btn);
              
              Scene scene = new Scene(root, 300, 250);
              
              primaryStage.setTitle("Hello Alert!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
          
      }

      Click on button. An alert with incorrect border will be displayed.

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            asarkar Anirvan Sarkar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: