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

Shell不能扩展子类有关问题

2012-07-01 
Shell不能扩展子类问题在开发过程中,有时需要断承Shell定义自己的shell,,但运行过程会抛出错误:Subclassin

Shell不能扩展子类问题
在开发过程中,有时需要断承Shell定义自己的shell,,但运行过程会抛出错误:Subclassing not allowed


解决办法:

   1)覆盖父类shell.checkSubclass()方法,方法体为空

    @Override
    protected void checkSubclass(){
     //Nothing
    }

  2)定义的子类包名为 org.eclipse.swt.widgets.xxxx

   package org.eclipse.swt.widgets.custom
   import org.eclipse.swt.widgets.Shell
   public class MyShell{
     //Code here
   }

热点排行