Java-Synth中图像之间的淡入淡出
对于类分配,我必须用java完美地复制Windows7计算器。目前,我正在研究悬停按钮。我遇到的问题是windows计算器在默认和悬停状态(以及按下状态)之间淡出。我想知道是否有可能使Java在我的两种状态之间消失 我目前拥有以下Synth代码Java-Synth中图像之间的淡入淡出,java,image,fade,look-and-feel,synth,Java,Image,Fade,Look And Feel,Synth,对于类分配,我必须用java完美地复制Windows7计算器。目前,我正在研究悬停按钮。我遇到的问题是windows计算器在默认和悬停状态(以及按下状态)之间淡出。我想知道是否有可能使Java在我的两种状态之间消失 我目前拥有以下Synth代码 <synth> <!-- Style that all regions will use --> <style id="backingStyle"> <!-- Make all t
<synth>
<!-- Style that all regions will use -->
<style id="backingStyle">
<!-- Make all the regions opaque-->
<opaque value="TRUE"/>
<font name="Dialog" size="12"/>
<state>
<!-- Provide default colors -->
<color value="#D8D987" type="BACKGROUND"/>
<color value="RED" type="FOREGROUND"/>
</state>
</style>
<bind style="backingStyle" type="region" key=".*"/>
<style id="buttonStyle">
<!-- Shift the text one pixel when pressed -->
<insets top="0" left="0" right="0" bottom="0"/>
<state>
<imagePainter method="buttonBackground" path="images/button.png" sourceInsets="10 10 10 10"/>
</state>
<state value="MOUSE_OVER">
<imagePainter method="buttonBackground" path="images/button_hover.png" sourceInsets="10 10 10 10"/>
</state>
<state value="PRESSED and MOUSE_OVER">
<imagePainter method="buttonBackground" path="images/button_pressed.png" sourceInsets="10 10 10 10"/>
</state>
</style>
<!-- Bind buttonStyle to all JButtons -->
<bind style="buttonStyle" type="region" key="Button"/>
</synth>
我发现了一个只在Java5中工作的示例,它可以在6-8个图像之间快速循环,使其看起来像是褪色的。这样的事情对我来说也很管用
如果你需要我没有发布的任何东西,你都可以得到
提前谢谢