?? splashexample.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 + -