SWT如何控制堆栈式面板之间的跳转
展开全部
StackLayout mainsl = new StackLayout();
mainsl.topControl = 要显示的容器;
例
Composite main = new Composite(parent, SWT.NONE);
//将main 设置为堆栈布局
StackLayout mainsl = new StackLayout();
main.setLayout(mainsl);
//在main容器上创建3个
Composite sub1=new Composite(main, SWT.NONE);
Composite sub2=new Composite(main, SWT.NONE);
Composite sub3=new Composite(main, SWT.NONE);
mainsl.topControl = sub1;// 首先显示sub1面板
某个监听事件中,mainsl.topControl = sub2;即会显示sub2面板
mainsl.topControl = 要显示的容器;
例
Composite main = new Composite(parent, SWT.NONE);
//将main 设置为堆栈布局
StackLayout mainsl = new StackLayout();
main.setLayout(mainsl);
//在main容器上创建3个
Composite sub1=new Composite(main, SWT.NONE);
Composite sub2=new Composite(main, SWT.NONE);
Composite sub3=new Composite(main, SWT.NONE);
mainsl.topControl = sub1;// 首先显示sub1面板
某个监听事件中,mainsl.topControl = sub2;即会显示sub2面板
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询