text shadow effect on controls

Jasper Potts jasper.potts at oracle.com
Mon May 28 11:09:25 PDT 2012


Hi Pedro,

That should work, the css selector is looking for a node of class "Text" which is a decedent of the control. So it find all Text nodes in the scenegraph below the node with the given ID then applys the effect to them. In new versions of JavaFX text nodes have the style class "text" by default so you can then use:

#MyControlID .text {
	-fx-effect: .....
}

But the old way should still work as well, if it doesn't then please file a bug in JIRA.

Jasper

On May 28, 2012, at 3:02 AM, Pedro Duque Vieira wrote:

> Hi,
> 
> To set drop shadows on text of controls, Jasper used an undocumented javafx
> css feature on his blog post:
> http://fxexperience.com/2011/12/styling-fx-buttons-with-css/comment-page-1/#comment-59982
> 
> 
> The syntax was:
> <control id> Text
> {
>   -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.8) , 0, 0.0 , 0 , -1
> );
> }
> 
> However this doesn't seem to work in 2.1. How can I add text shadow effects
> on controls on 2.1?
> 
> -- 
> Pedro Duque Vieira



More information about the openjfx-dev mailing list