java介面问题啦 有代码

yff1029 2013-03-16 09:01:57
import org.eclipse.swt.SWT;
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.events.*;
public class test1 {
public static void main(String[] args){
int x=0;
final Display display=new Display();
final Shell shell=new Shell(display);
Button bt=new Button(shell,SWT.NONE);
bt.setText("wef");
bt.setBounds(10, 100, 100, 25);

bt.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
Shell shell1=new Shell(display);
Label label=new Label(shell1,SWT.BORDER);
label.setText("dges");
label.setBounds(10, 100, 100, 25);
shell1.open();

}
});
shell.open();
while (!shell.isDisposed()){
if(!display.readAndDispatch()){
display.sleep();
}
}
display.dispose();
}
}
这个SWT界面的代码 ,点击button后出现了一个界面 , 怎么把之前的界面给隐藏。
...全文
129 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
LCore 2013-03-17
  • 打赏
  • 举报
回复
没有,但是应该有类似的方法吧 你去查吧
yff1029 2013-03-17
  • 打赏
  • 举报
回复
引用 2 楼 kiritor 的回复:
引用 1 楼 kiritor 的回复: 晕 frame.setVisiable(flase) 写错了,改正如下 frame.setVisiable(false)
额 这里面没有frame啊 SWT里面有frame吗??
dw_java08 2013-03-16
  • 打赏
  • 举报
回复
引用 1 楼 kiritor 的回复:
晕 frame.setVisiable(flase)
LCore 2013-03-16
  • 打赏
  • 举报
回复
引用 1 楼 kiritor 的回复:
晕 frame.setVisiable(flase)
写错了,改正如下 frame.setVisiable(false)
LCore 2013-03-16
  • 打赏
  • 举报
回复
晕 frame.setVisiable(flase)

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧