WindowManager.getDefault().findTopComponent返回为null

mac2022-06-30  26

《NetBeans Platform 6.9 Developer's Guide》第5章遇到一个问题:

按书中所讲把TaskEditorTopComponent的无参构造函数改为private

结果在TaskDuplicatorTopComponent.java中执行这一句

WindowManager.getDefault().findTopComponent("TaskEditorTopComponent").getLookup().lookupResult(Task.class);

的时候报NullPointerException异常。

转载于:https://www.cnblogs.com/cuizhf/archive/2011/08/12/2135789.html

最新回复(0)