text shadow effect on controls

Pedro Duque Vieira pedro.duquevieira at gmail.com
Mon May 28 13:29:26 PDT 2012


Hi Jasper,

No it doesn't seem to be working (using Text instead of .text). I'll file a
Jira bug than.

I like the fact that you can target the text of controls through css, this
is actually more powerful than the HTML/CSS solution.

Thanks, best regards,

On Mon, May 28, 2012 at 7:09 PM, Jasper Potts <jasper.potts at oracle.com>wrote:

> 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
>
>


-- 
Pedro Duque Vieira


More information about the openjfx-dev mailing list