public abstract class BaseView extends JWindow{ ... (实现一些取得界面控件,和界面信息的方法). }
2.每个界面类都象这样定义:
public class MyView extends BaseView{ JPanel myPanel; public void playoutPanel(){ JButton myButton = new JButton("OK"); myPanel.add(myButton); ...... (添加你需要的控件和布局到myPanel上) } }
public void jump(){ MyView myView = new MyView(); int id = ViewJump.registerPath(this.xxPanel,this); ViewJump.setNext(id,myView.getPanel()); ViewJump.jump(id); }
MyView中退回的部分:
protected void goBack(){ int id = ViewJump.registerPath(this.myPanel,this); ViewJump.back(id); }