Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Changing data in a stylesheet after an event happens?

KonradZuseNov 16 2013 — edited Dec 2 2013

Hello all,

sorry if my title doesn't make too much sense, but basically I have a slider that I want to change colors based on which major tick it is on.


I figure I could make 5 different css files, but that seems a bit much. 


I also thought about changing the style inline, but I have to set 3 labels, as well as all of the parts of my slider, so I think that would be annoying to have to do that within the listener I already have setu.

It would be nice if in the stylesheets we could conditional styles.

i.e.,

if(i == 1)

.text

{
-fx-fill: red;
}

If anyone has any better ideas I would appreciate it, or else I'll have to go with the 5 stylesheets(lame but w/e ).


Thanks as always,

~KZ

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2013
Added on Nov 16 2013
18 comments
1,513 views