Issue
I am using the following code to show an error alert :
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setContentText(resourceBundle.getString("loginError"));
alert.showAndWait();
href="https://i.stack.imgur.com/WUG4g.png" rel="nofollow noreferrer">
This alert looks a little weird to me as there are two panes the top one just showing Error and a cross button and the bottom one showing the text incorrect username or password
Is there some way to get rid of the top pane?
As the header pane already showing Error and cross button I don't see the reason for the next pane to show Error and a red cross button
Solution
To remove the header try,
alert.setHeaderText(null);
To remove the icon try,
alert.setGraphic(null);
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setContentText("Incorrect Username or Password");
alert.setHeaderText(null);
alert.setGraphic(null);
alert.showAndWait();
Answered By - SedJ601
Answer Checked By - Candace Johnson (JavaFixing Volunteer)