?? animationdemo.java
字號:
/* * Copyright ?2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */package com.sun.lwuit.uidemo;import com.sun.lwuit.Button;import com.sun.lwuit.Command;import com.sun.lwuit.Form;import com.sun.lwuit.events.ActionEvent;import com.sun.lwuit.events.ActionListener;import com.sun.lwuit.layouts.BoxLayout;import com.sun.lwuit.util.Resources;import java.io.IOException;/** * Demonstrates simple animation both static and manual * * @author Shai Almog */public class AnimationDemo implements ActionListener { public Form form = new Form("AnimationDemo"); private Command backCommand = new Command("Back", 1); AnimationDemo() { try { form.addCommand(backCommand); form.setCommandListener(this); Button animation = new Button(Resources.open("/res/duke.res").getAnimation("duke3_1.gif")); animation.setBorderPainted(false); animation.getStyle().setBgTransparency(0); form.setLayout(new BoxLayout(BoxLayout.Y_AXIS)); form.addComponent(animation); } catch (IOException ex) { ex.printStackTrace(); } } public void actionPerformed(ActionEvent arg0) { if(arg0.getCommand()==backCommand) { UIDemoMIDlet.backToMainMenu(); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -