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);
}
}
我不知道是否有可能這個保存到一個文件,不是從沒有這個代碼加載該文件的程序和「重新創建」窗口,就好像它是代碼的一部分一樣...