在 SWT 中如何将一个按钮放在另一个按钮前面
In SWT how can I bring one button infront of another
如何在 SWT 中将 "NewButton" 放在 "Button" 前面?请参考下图: 换句话说,如何将"Button"发送到"NewButton"的后面?
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10,10,300,300);
Button b =new Button(shell, SWT.NONE);
b.setText("Button");
b.setBounds(60,60,80,80);
Button button = new Button(shell, SWT.PUSH);
button.setText("NewButton");
button.setBounds(120,120,90,90);
button.moveAbove(b); shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
如何在 SWT 中将 "NewButton" 放在 "Button" 前面?请参考下图: 换句话说,如何将"Button"发送到"NewButton"的后面?
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10,10,300,300);
Button b =new Button(shell, SWT.NONE);
b.setText("Button");
b.setBounds(60,60,80,80);
Button button = new Button(shell, SWT.PUSH);
button.setText("NewButton");
button.setBounds(120,120,90,90);
button.moveAbove(b); shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}