📄 browserexample.java
字号:
package com.novocode.naf.example.browser;
import com.novocode.naf.app.NAFApplication;
import com.novocode.naf.gui.event.DisposeWindowActionListener;
import com.novocode.naf.gui.event.SetObjectModelValueActionListener;
import com.novocode.naf.model.*;
import com.novocode.naf.resource.*;
/**
* Browser example.
*
* @author Stefan Zeiger (szeiger@novocode.com)
* @since Oct 24, 2004
*/
public class BrowserExample
{
private static final String HOME_URL = "http://www.novocode.com/naf";
public static void main(String[] args)
{
final NAFApplication app = new NAFApplication(BrowserExample.class);
NGComponent win = app.getResource("browser.naf#shell");
ModelMap models = new ModelMap();
final DefaultStringModel urlInputModel = new DefaultStringModel(HOME_URL);
final IStringModel urlModel = urlInputModel.getForwarderModel();
models.put("urlinput", urlInputModel);
models.put("url", urlModel);
models.put("closeWindow", new DisposeWindowActionListener());
models.put("go", new SetObjectModelValueActionListener<String>(urlModel, urlInputModel));
models.put("home", new SetObjectModelValueActionListener<String>(urlModel, HOME_URL));
app.runMainWindow(win, models);
app.dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -