当前位置: 代码迷 >> Eclipse >> swt动状态生成Text为什么会不成功那?解决办法
  详细解决方案

swt动状态生成Text为什么会不成功那?解决办法

热度:75   发布时间:2016-04-23 14:27:10.0
swt动状态生成Text为什么会不成功那?
        Button   button   =   new   Button(shell,   SWT.PUSH);
        button.setText( "Push   Me ");
        button.addSelectionListener(new   SelectionAdapter()   {
            public   void   widgetSelected(SelectionEvent   event)   {
                PopupList   list   =   new   PopupList(shell);
                list.setItems(OPTIONS);        
                Text   t   =   new   Text(shell,   SWT.SINGLE);
t.setText( "china ");
t.setVisible(true);
            }
swt动状态生成Text为什么会不成功那?


------解决方案--------------------
看JDKAPI
------解决方案--------------------
我觉得是程序上的问题,有错误
Button button = new Button(shell, SWT.PUSH);
button.setText( "Push Me ");
button.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {

}

});
应该是这样的一个结构.你的那个有点不对劲,改改看吧
  相关解决方案