This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The icon editor which picks an icon from a project creates bad code: new ImageIcon(getClass().getResource(...)) This is unsafe because a subclass of the form class in a different package will throw an NPE trying to load this icon. The code should read new ImageIcon(ThisClass.class.getResource(...))
Since it uses an absolute icon path, a subclass would still be able to load the icon even if it were in a different package, and probably even if in a different class loader (unless package restrictions are in effect). Still poor style and may trigger warnings from code style checkers looking for getClass().getResource("relative") which is always wrong.
Created attachment 77125 [details] Suggested patch
*** Bug 122477 has been marked as a duplicate of this bug. ***