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

📄 splashexample.java

📁 Novocode的 SWT 控件框架 丰富了MDI功能
💻 JAVA
字号:
package com.novocode.naf.example.splash;

import com.novocode.naf.app.NAFApplication;
import com.novocode.naf.gui.WindowInstance;
import com.novocode.naf.model.*;


/**
 * Display a splash screen.
 * 
 * @author Stefan Zeiger (szeiger@novocode.com)
 * @since Jan 5, 2004
 */

public final class SplashExample implements Runnable
{
  private IStringModel msgModel = new DefaultStringModel();
  private IIntModel progressModel = new DefaultIntModel();

  private WindowInstance wi;


  public SplashExample(ModelMap models)
  {
    models.put("msg",      msgModel);
    models.put("progress", progressModel);
  }


  public void run()
  {
    for(int i=0; i<100; i++)
    {
      msgModel.setValue("Initialization stage "+(i/20+1)+" of 5...");
      try { Thread.sleep(50); } catch(InterruptedException ignored) {}
      progressModel.setInt(i+1);
    }
    wi.dispose();
  }    


  public static void main(String[] args) throws Exception
  {
    final NAFApplication app = new NAFApplication(SplashExample.class);
    ModelMap models = new ModelMap();
    SplashExample splashRunner = new SplashExample(models);
    splashRunner.wi = app.createInstance(app.getResource("splash.naf"), models);
    splashRunner.wi.open();
    new Thread(splashRunner).start();
    app.runApp();
    app.dispose();
    System.exit(0);
  }
}

⌨️ 快捷键说明

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