Refill a SVG Path with onMouseEntered event in JavaFX

寵の児 提交于 2019-12-04 22:41:19

Well, let me suggest some answer.

Looks like, you have to apply some css to your scene. Let me describe, how it should look like :

Look at the css reference, at the part about "". This type, is a type of -fx-effect property, which is applyable to nodes. SVGPath is a shape, so, a node. Look, at how inner shadow is applied :

innershadow( <blur-type> , <color> , <number> , <number> , <number> , <number> )

you need to apply this (other effects are not supported) to your SVGPaths, when they are hovered. "hover" is a name of such pseudo class.

Now, we need to write a selector for your SVGPaths. Unfortunately, SVGPath has no predefined style-class. So, you need obviously set that style class in your fxml. Suppose, you set style-class "svg-path".

Then, you can apply such css to your scene with map :

.svg-path:hover{-fx-effect:innershadow(...)}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!