长期以来在找RowLayout和ScrolledComposite 兼容的方式,就是在使用时ScrolledComposite的横向滚动不会出现,而由RowLayout自动换行,终于给我找到了比较好的解决方式,现贡献出来供大家分享.另外该方式在SWING中不适用,那位可以帮忙移植出一个SWING的版本,我愿贡献100分public class TilePanel extends Composite implements ControlListener{

public TilePanel(ScrolledComposite pater,int style){
super(pater, style);
RowLayout rowlayout = new RowLayout();
rowlayout.spacing=0;
setLayout(rowlayout);
pater.setContent(this);
pater.addControlListener(this);
pater.setExpandVertical(true);
pater.setExpandHorizontal(true);
}

public void controlMoved(ControlEvent arg0) {
// TODO Auto-generated method stub

} public void controlResized(ControlEvent arg0) {
// TODO Auto-generated method stub
layout();
}

public void layout() {
ScrolledComposite parent = (ScrolledComposite) getParent();
Rectangle rect = parent.getClientArea();
Point size = computeSize(rect.width, SWT.DEFAULT);
parent.setMinSize(size);
super.layout();
}}