首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

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

2012-02-19 
swt动状态生成Text为什么会不成功那?ButtonbuttonnewButton(shell,SWT.PUSH)button.setText( PushMe )

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) {

}

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

热点排行