When i'm creating TextField in my App then in it then there are places where appears blur.
Example: 1.There is a blur at the beginning of input :
- After a few taps on Space blur disappears:
- Last character display distortion:
Then the blur appears again, and this happens throughout the field. I don't understand why this is happens and hox fix it
Code of fragment if this need:
private void inputSaveName() {
Stage nameStage = new Stage();
nameStage.initModality(Modality.WINDOW_MODAL);
nameStage.initOwner(saveStage);
nameStage.initStyle(StageStyle.UNDECORATED);
nameStage.initStyle(StageStyle.TRANSPARENT);
BorderPane saveBorder = new BorderPane();
saveBorder.setStyle("-fx-background-color:saddlebrown;" +"-fx-border-width:5;" + "-fx-border-radius:16;" + "-fx-font-family: Cambria;" + "-fx-border-color:olive");
Scene nameScene = new Scene (saveBorder,300,120);
nameScene.setFill(Color.TRANSPARENT);
Rectangle rect = new Rectangle(300,120);
rect.setArcHeight(40.0);
rect.setArcWidth(40.0);
saveBorder.setClip(rect);
Button acceptNameButton = new Button("Accept");
Button cancelNameButton = new Button("Cancel");
acceptNameButton.setStyle("-fx-background-color: darkkhaki;" + "-fx-background-insets: 0 2 2 0;" + "-fx-padding: 8;" + "-fx-font-size:15;" + "-fx-text-alignment:
center");
cancelNameButton.setStyle("-fx-background-color: darkkhaki;" + "-fx-background-insets: 0 0 2 2;" + "-fx-padding: 8;" + "-fx-font-size:15;" + "-fx-text-alignment:
center");
cancelNameButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent ae) {
nameStage.close();
}
});
TextField nameField = new TextField();
nameField.setPromptText("Write save name");
nameField.setFont(new Font(18));
HBox buttonBox = new HBox();
buttonBox.setAlignment(Pos.CENTER);
buttonBox.setHgrow(acceptNameButton, Priority.ALWAYS);
buttonBox.setHgrow(cancelNameButton, Priority.ALWAYS);
acceptNameButton.setMaxWidth(130);
cancelNameButton.setMaxWidth(130);
buttonBox.getChildren().addAll(acceptNameButton,cancelNameButton);
saveBorder.setBottom(buttonBox);
saveBorder.setCenter(nameField);
nameStage.setScene(nameScene);
nameStage.show();
}



