java小程序中的淡入淡出效果 [英] Fade in and fade out effect in java applet
问题描述
我正在制作带有节点和边的 Java 小程序图形.我想实现在单击一个节点时检索新节点时的淡入淡出效果,但我不知道如何编写和实现代码.为了澄清,例如动物节点检索老虎和狮子节点.所以当动物被点击时,节点和附着在它上面的边缘逐渐消失,老虎和狮子节点逐渐出现.
I am making this java applet graphics with nodes and edges. I want to implement the fade-in and fade out effect on retrieval of the new nodes when one node is clicked, but I don't know how to write and implement the code. To clarify, for example animal node retrieves tiger and lion nodes. so when animal is clicked the node and the edge attached to it gradually fades away and the tiger and lion nodes gradually appear.
提前致谢
推荐答案
这个 示例 使用 AlphaComposite
进行淡入淡出.或者,这个示例根据饱和度组成颜色表.
This example uses AlphaComposite
to do the fading. Alternatively, this example composes a color table based on saturation.
这篇关于java小程序中的淡入淡出效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!