java - Css class is not loaded for imageView javafx -
i have css file:
.-fx-attribute-label { -fx-min-width: 50; -fx-font-weight: bold; } ... .img-view { -fx-stroke-width: 2.0; } .img-view:hover { -fx-stroke: #70c0e7; } .img-view:selected { -fx-stroke: #26a0da; }
and try add img-view class imageview:
pairstream.foreach(id -> { final imageview imgview = new imageview(id.getvalue()); imgview.getstyleclass().add("img-view"); facesview.getchildren().add(imgview); //facesview hbox contains imageviews children ... });
i need highlight on hover , when selected doesn't work. know css file loaded because other class -fx-attribute-label works. why it's not working img-view class?
imageview not subclass of shape hence not have eg stroke attribute - refer http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html see attributes can set on imageview.
your use case has solved wrapping image stackpane , handling hover there.
Comments
Post a Comment