JAVA中使用SWT新建了两个Button,放在同一个位置,如何设置层次

2025-04-07 22:39:15
推荐回答(4个)
回答1:

建议你在显示table那里放置一个composite,这个composite使用栈布局,之后你要显示几个表格就往composite上new多少个,通过按钮去控制栈布局最顶层显示控件,具体请了解stacklayout

回答2:

用CardLayout卡片布局即可。

回答3:

seLayout(null);设置空布局

button1.setBounds(x,y,weigth,heigth);

button1.setBounds(x,y,weigth,heigth);
以上想怎么设置就怎么设置

回答4:

先定义的在下面,后定义的在上面啊