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

TextField prompt text does not disappear when used with -fx-prompt-text-fill

XMLWordPrintable

    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
      When a user clicks a text field the prompt text disappears. However this does not work when the CSS option -fx-prompt-text-fill: red; is used!

      REGRESSION : Last worked in version 8u161

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The prompt text should be hidden when the text field is focused.
      ACTUAL -
      The prompt text is still shown.

      ---------- BEGIN SOURCE ----------
      public class Main extends Application {

      @Override
      public void start(Stage primaryStage) throws Exception{
      Stage stage = new Stage();
      final TextField a = new TextField();
      a.setPromptText("This is a prompt text");
      a.setStyle("-fx-prompt-text-fill: red;");
      VBox box = new VBox(0);
      box.setMinWidth(0);
      box.setFillWidth(false);
      box.getChildren().addAll(a, new TextField());
      stage.setScene(new Scene(box, 200, 200));
      stage.show();
      }


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

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: