刚刚解除swt,写了一小段代码,怎么样才能使这个界面里的控件,根据这个shell的大小,自动变化大小呢?

malegebicaonima 2010-03-25 03:54:25
SashForm form  = new SashForm(tabFolder,SWT.HORIZONTAL|SWT.SMOOTH);
form.setLayout(new FillLayout());


Composite composite1_1 = new Composite(form, SWT.MULTI);
//composite1_1.setLayout(new FillLayout(SWT.VERTICAL));
Text text1_1 = new Text(composite1_1, SWT.BORDER);
text1_1.setText("This is page 1");
text1_1.setBounds(new Rectangle(10, 10, 100, 20));

Text nnn = new Text(composite1_1, SWT.BORDER);
nnn.setText("This is page 1sdadasdasdas");
nnn.setBounds(new Rectangle(10, 50, 100, 20));



Composite composite1_2 = new Composite(form, SWT.MULTI);
composite1_2.setLayout(new FillLayout());
StyledText text1_2 = new StyledText(composite1_2, SWT.BORDER);
text1_2.setText("This is page 1543677");
text1_2.setEditable(false);
text1_2.setBounds(new Rectangle(500, 10, 100, 20));
...全文
49 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
这个不太好写吧?
malegebicaonima 2010-03-26
  • 打赏
  • 举报
回复
0.0
malegebicaonima 2010-03-25
  • 打赏
  • 举报
回复
0.0
malegebicaonima 2010-03-25
  • 打赏
  • 举报
回复
主要是这个问题,我想把text1_1和nnn ,这两个text根据form 拖动的位置,自动的变长或者变短。。。。应该怎么做啊?

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧