代码如下:
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.RowLayout;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根 final Display display = new Display();
final Shell shell = new Shell(display);
RowLayout layout=new RowLayout();
shell.setLayout(layout);
Button b=new Button(shell,SWT.PUSH);
b.setText("hello");
b.setToolTipText("中山南路");
b.pack();
shell.pack();
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}}
程序能运行,就是鼠标放在Button上不出来提示?
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.RowLayout;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根 final Display display = new Display();
final Shell shell = new Shell(display);
RowLayout layout=new RowLayout();
shell.setLayout(layout);
Button b=new Button(shell,SWT.PUSH);
b.setText("hello");
b.setToolTipText("中山南路");
b.pack();
shell.pack();
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}}
程序能运行,就是鼠标放在Button上不出来提示?
SWT和swing能通用吗?高手说给个代码吧