JDK-8118147 : -fx-highlight-text-fill does not work for TextField / PasswordField
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-08-26
  • Updated: 2015-06-17
  • Resolved: 2011-10-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx2.0.2Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The following code demonstrates this problem:


public class HelloTextField extends Application {
    private Group content;
    private String sourceBorder = HelloTextField.class.getResource("border.png").toExternalForm();

    @Override
    public void start(Stage stage) throws Exception {
        stage.setScene(new Scene(content = new Group(), 500, 500));
        stage.centerOnScreen();
        stage.show();

        final TextField label = new TextField();
        label.setPromptText("Enter Pithy Pun");

        label.setStyle("-fx-text-fill:green;"
                + "-fx-prompt-text-fill: blue;"
                + "-fx-highlight-fill: yellow;"
                + "-fx-highlight-text-fill: red;"
                );
        content.getChildren().add(label);
    }


    public static void main(String[] args) {
        Application.launch(HelloTextField.class, args);
    }
}

Comments
This one is verified for single-line case on build 2.0.2b08.
15-11-2011

Multiline case filed as RT-17667.
28-10-2011

Added test case RT16386.java showing two Text nodes, one with a single line of text and one with two lines. The highlight works only on the first node.
27-10-2011

This fix does not work if the Text node string contains a newline. I'll post a new test case with just a Text node instead of a TextField.
27-10-2011

When I pushed this change it exposed an existing bug. By doing the right thing in NGText, namely clearing the cached selection shape on geomChanged, lead to a out of range exception. Once RT-17568 is fixed I should be able to reapply my backed-out changeset.
24-10-2011

This change had to be backed out because it caused RT-17483. When reapplying the fix, you will need to ensure that RT-17483 does not reappear.
18-10-2011

Fixed in graphics runtime changeset: 14667:abdcd065e693 JavaFX 2.0.2 Build #110
17-10-2011

SQE - ok to defer
31-08-2011

SQE - ok to defer
31-08-2011

If we can't get to it for Presidio, then lets go through the deferral process.
26-08-2011

This functionality is missing due to the following method not being implemented in NGText: public void setSelectionPaint(Object strokePaint, Object fillPaint) { //throw new UnsupportedOperationException("Not supported yet."); }
26-08-2011