谁可以用java实现手机上面的那种九宫图啊。不准用插件。自己敲代码。

解决方案 »

  1.   

    <AUnit >
    <Insert>
    <Transform>
    <Transform active="false">
    <Shape DEF="Rectangle" filled="true" color="#ff0000"
    points="<%=ShapeUtils.generateRectanglePoints(60,20) %>"></Shape>
    </Transform>
    <Transform translation="-80 100" delta="0 -80">
    <%
    for (int i = 1; i < 4; i++) {
    %>
    <Transform delta="80 0">
    <%
    for (int j = 1; j < 4; j++) {
    %>
    <Transform> <Transform DEF='<%="NUM"+i+""+j%>' active="<%=(i==1)&&(j==1) %>"  >
    <Use target="Rectangle"/>
    <%
    if(i!=1){
    %>
    <Action keyCodes="UP">
    <ActionKey showObject='<%="NUM"+(i-1)+""+j%>' />
    <ActionKey hideObject='<%="NUM"+i+""+j %>' />
    </Action>
    <%
    }
    %>
    <%
    if(i!=3){
    %>
    <Action keyCodes="DOWN">
    <ActionKey showObject='<%="NUM"+(i+1)+""+j%>' />
    <ActionKey hideObject='<%="NUM"+i+""+j %>' />
    </Action>
    <%
    }
    %>
    <%
    if(j!=1){
    %>
    <Action keyCodes="LEFT">
    <ActionKey showObject='<%="NUM"+i+""+(j-1)%>' />
    <ActionKey hideObject='<%="NUM"+i+""+j %>' />
    </Action>
    <%
    }
    %>
    <%
    if(j!=3){
    %>
    <Action keyCodes="RIGHT">
    <ActionKey showObject='<%="NUM"+i+""+(j+1)%>' />
    <ActionKey hideObject='<%="NUM"+i+""+j %>' />
    </Action>
    <%
    }
    %>
    </Transform>
    <Text string='<%="NUM"+i+j%>' size="LARGE" vertAlign="MIDDLE"
    horizAlign="CENTERED"   />
    </Transform>
    <%
    }
    %>
    </Transform>
    <%
    }
    %>
    </Transform>
    </Transform>
    </Insert>
    </AUnit>