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