import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

public class AlertNoneNoHeaderTest extends Application {

    @Override
    public void start(final Stage primaryStage) throws Exception {
        final Button alertDialog = new Button("Show Alert");
        alertDialog.setOnAction(e -> showAlert());
        Scene scene = new Scene(new VBox(5, alertDialog), 200, 100);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    private void showAlert() {
        final Alert alert = new Alert(Alert.AlertType.NONE);
        alert.setGraphic(new Rectangle(10, 10, Color.RED));
        alert.getDialogPane().setPrefSize(300, 200);
        final BorderPane pane = new BorderPane();
        pane.setStyle("-fx-background-color: black");
        alert.setGraphic(new Rectangle(10, 10, Color.RED));
        alert.getDialogPane().setContent(pane);
        alert.getButtonTypes().add(ButtonType.CLOSE);
        alert.setTitle("Alert type None");
        alert.show();
    }

}

