i need to create a java notification that once show fades over time and then is destroyed, but if the user mouses over it it should become alive. I essentially need to set the transparency of the entire notification (background, labels and image views) over a period to fully transparent. I've searched the web and can't find a straightforward way to do it in javafx any help?
Asked
Active
Viewed 85 times
0
-
2Combine Deepanshu's answer to fade on the root node with a mouse listener to stop fading and a [transparent scene background](http://stackoverflow.com/questions/14972199/how-to-create-splash-screen-with-transparent-background-in-javafx) so the app can truly "disappear". Give it a go and see how far you get. – jewelsea Jul 30 '14 at 10:10
1 Answers
1
Read about transition here.
Example on how to achieve fading here:
final Rectangle rect1 = new Rectangle(10, 10, 100, 100);
rect1.setArcHeight(20);
rect1.setArcWidth(20);
rect1.setFill(Color.RED);
...
FadeTransition ft = new FadeTransition(Duration.millis(3000), rect1);
ft.setFromValue(1.0);
ft.setToValue(0.1);
ft.setCycleCount(Timeline.INDEFINITE);
ft.setAutoReverse(true);
ft.play();

flotothemoon
- 1,882
- 2
- 20
- 37

Deepanshu J bedi
- 1,530
- 1
- 11
- 23
-
this is only for node objects how do i apply it to stages and popups? thanks in advance – cr0mbly Jul 30 '14 at 10:24
-
more examples are in the link. it will explain how to apply it to stages and popups and accept my answer :P.@user3619109 – Deepanshu J bedi Jul 30 '14 at 10:26