FULL PRODUCT VERSION :
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 10 Home
A DESCRIPTION OF THE PROBLEM :
When the -fx-opacity attribute of the JavaFX TextArea component is set to 0.5 for disabled componenets it is actually rendered as closer to 0.25. The same settings for the TextField yield a correct result. When the two componenets are placed beside each other it becomes apparent that the opacity is not consistent.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JavaFX application with two componenets, a TextField and a TextArea. Use the following css file to style it:
.text-field,
.text-area {
-fx-text-fill: #000;
-fx-opacity: 1.0;
}
.text-field:disabled,
.text-area:disabled {
-fx-text-fill: #000;
-fx-opacity: 0.5;
}
When the "disabled" property of both components are toggled, the difference in opacity becomes visible. It looks like the reason for this bug is that both the TextArea and the embedden ScrollPane applies opacity to the component.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The color of the foreground and background of both components should be the same. A resulting text color of #7a7a7a is expected.
ACTUAL -
The TextArea foreground color is slightly lighter than the TextField. The TextField has a resulting color of #7a7a7a but the TextArea get #c7c7c7.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Set the opacity of the embedded ScrollPane to 1.0 to avoid the value from being applied twice.
.text-input > .scroll-pane:disabled {
-fx-opacity: 1.0;
}
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 10 Home
A DESCRIPTION OF THE PROBLEM :
When the -fx-opacity attribute of the JavaFX TextArea component is set to 0.5 for disabled componenets it is actually rendered as closer to 0.25. The same settings for the TextField yield a correct result. When the two componenets are placed beside each other it becomes apparent that the opacity is not consistent.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JavaFX application with two componenets, a TextField and a TextArea. Use the following css file to style it:
.text-field,
.text-area {
-fx-text-fill: #000;
-fx-opacity: 1.0;
}
.text-field:disabled,
.text-area:disabled {
-fx-text-fill: #000;
-fx-opacity: 0.5;
}
When the "disabled" property of both components are toggled, the difference in opacity becomes visible. It looks like the reason for this bug is that both the TextArea and the embedden ScrollPane applies opacity to the component.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The color of the foreground and background of both components should be the same. A resulting text color of #7a7a7a is expected.
ACTUAL -
The TextArea foreground color is slightly lighter than the TextField. The TextField has a resulting color of #7a7a7a but the TextArea get #c7c7c7.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Set the opacity of the embedded ScrollPane to 1.0 to avoid the value from being applied twice.
.text-input > .scroll-pane:disabled {
-fx-opacity: 1.0;
}
- duplicates
-
JDK-8152392 Text in a disabled TextArea is lighter than text in a disabled TextField
-
- Resolved
-