public class HelloWorld {
public static void main(String args[]) {
Shell shell = new Shell();
shell.setText("Draw2d Hello World");
shell.pack(); shell.open();
// create content 4 shell.
createContent4Shell(shell);
while (!shell.isDisposed ()) {
if (!Display.getDefault().readAndDispatch ())
Display.getDefault().sleep ();
}
}
private static void createContent4Shell(Shell shell) {
IFigure panel = new Panel();
panel.setLayoutManager(new FlowLayout());
for(int i=0; i<100; i++) {
panel.add(new Label("Label " + i));
}
LightweightSystem lws = new LightweightSystem(shell);
lws.setContents(panel);
}
}
FlowLayout布局管理器在swt中也有对应的布局管理器,应用起来也是比较的简单。可以根据外部的窗口大小的变化自动调整内部的布局。
/**
* Lays out children in rows or columns, wrapping when the current row/column is filled.
* The aligment and spacing of rows in the parent can be configured. The aligment and
* spacing of children within a row can be configured.
*/
- 大小: 9.1 KB
分享到:
相关推荐
流失布局,FlowLayout,FlowLayout,FlowLayoutFlowLayout
recyclerview实现flowlayout效果的demo,注意点都在demo里注明了
Android Material FlowLayout简单使用
FlowLayout Android流式布局,支持单选、多选等,适合用于产品标签等。 特色 以setAdapter形式注入数据 直接设置selector为background即可完成标签选则的切换,类似CheckBox 支持控制选择的Tag数量,比如:单选、...
flowLayout,顺序布局,自动换行。
Android流式布局FlowLayout,用起来爽歪歪,好用=-=-=-=-=
FlowLayout 流式标签 标签控件 自动换行效果 参照效果http://blog.csdn.net/lmj623565791/article/details/38352503
关于FlowLayout自动换行的问题
android-flowlayout A very convenient and powerful flow layout created by Lan. minSdkVersion 11 Dependencies latest version see it as an icon in the beginning of the README file. gradle compile '...
FlowLayout是一个流试布局,自动适配换行,实现了单选选中事件
自定义flowlayout,上下俩个flowlayout,里面有textview,点击会上跳下跳,在上面flowlayout里的textview意为选中。会把选中的数据传给第一个界面的水平scrollwview显示,还做了数据持久化。很不错滴!
Qt FlowLayout布局 Qt FlowLayout布局 Qt FlowLayout布局 Qt FlowLayout布局