行レイアウトで作成された要素の順序を変更する方法はありますか? 最初に表示された要素に表示します。たとえば 私が作成する最後の要素になります最初の要素となりますことを意味 element4要素3要素2要素1RowLayout SWTの要素の順序を変更するJava
ようなレイアウトを見たい要素2要素3、element4
、その後、要素1を作成した場合シェルに表示されます。
行レイアウトを使用して簡単に操作できますか?
次の例を表示するように変更します。 Button99 Button98 Button97 Button96 Button95 Button94 ............................。
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class TestExample
{
public static void main(String[] args)
{
Display display = Display.getDefault();
Shell shell = new Shell(display);
RowLayout rowLayout = new RowLayout();
shell.setLayout(rowLayout);
for (int i=0;i<100;i++)
{
Button b1 = new Button(shell, SWT.PUSH);
b1.setText("Button"+i);
}
shell.open();
while (!display.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
}
}
ありがとうございました。
返信いただきありがとうございます。 – user1205079