1

クラスの割り当てのために、Windows 7 電卓を Java で完全に複製する必要があります。現在、ボタンのホバーに取り組んでいます。私が抱えている問題は、Windows 電卓がデフォルトとホバー状態 (および押された状態) の間でフェードすることです。Javaが私の2つの状態の間でフェードアウトするようにすることが可能かどうか知りたい.

現在、次のシンセコードがあります。

<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>

Java 5 でのみ機能する例を見つけました。これは、6 ~ 8 枚の画像をすばやく切り替えて、フェードしているように見せます。そのようなものも私のために働くでしょう。

私が投稿していないものが必要な場合は、ここですべて入手できます

前もって感謝します。

4

0 に答える 0