0
比方说,一类AnotherShell从加载文件创建一个动态的外壳
public class AnotherShell
{
private Shell shell;
public AnotherShell()
{
shell = new Shell(Display.getCurrent());
Button btnNewButton = new Button(shell, SWT.NONE);
btnNewButton.addSelectionListener(new SelectionAdapter() {
@Override
public void mouseUp(SelectionEvent e) {
System.out.print("Selected\n");
}
});
}
public void open()
{
shell.open();
}
public void close()
{
shell.setVisible(false);
}
}
我不知道是否有可能这个保存到一个文件,不是从没有这个代码加载该文件的程序和“重新创建”窗口,就好像它是代码的一部分一样...