⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 numscreen.java

📁 为解压缩文件
💻 JAVA
字号:
/*
 * Created on 2004-12-21
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.j2medev.numbergame;

import java.util.Timer;
import java.util.TimerTask;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Font;

import com.nokia.mid.ui.FullCanvas;

public abstract class NumScreen extends FullCanvas
{
    protected Timer timer = new Timer();
    protected Display display;
    protected Manager next;
    protected int timeout;
    protected Font font;
    
    public NumScreen(Display display,Manager next)
    {
        this.display = display;
        this.next = next;

        setTimeout(3000);
    }
    
    public Font getFont()
    {
        if(font == null)
        {
            font = Font.getDefaultFont();
        }
        return font;
    }
    
    public void setFont(Font font)
    {
        this.font = font;
    }
    
    public void setTimeout(int time)
    {
        this.timeout = time;
    }
    
    
    public void dismiss()
    {
        timer.cancel();
        display.setCurrent(next);
    }
    
    public void showNotify()
    {
        timer.schedule(new TimerTask()
                {
            		public void run()
            		{
            		    dismiss();
            		}
                },3000);
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -