我是 JAVA 桌面应用程序开发的新手,最初开始在默认包下创建所有类。后来我知道这不是一个好的做法,所以我根据它们的功能将我的类移动到不同的包中。作为这种转变的一部分,我通过重构将我的 GUI 类与两个自定义 JPanel 组件一起移动到一个包 (bd.ac.du.bmpt.gui) 中。然后我对我的项目进行了清理和构建,并运行了应用程序。一切似乎都很好。没有编译或运行时错误或任何东西。但是当我尝试在我的 GUI 类中切换到设计视图时,它显示了与两个自定义 JPanel 组件相关的表单加载错误。
它抛出了这些异常:
java.lang.ClassNotFoundException: GPanel
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1474)
at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:98)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:530)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:348)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
at org.openide.util.Mutex.readAccess(Mutex.java:322)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:345)
at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:462)
at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
java.lang.ClassNotFoundException: GPanel
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1474)
at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:98)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:530)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:348)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
at org.openide.util.Mutex.readAccess(Mutex.java:322)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:345)
at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:462)
at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
java.lang.ClassNotFoundException: GridPanel
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1474)
at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:98)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:530)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:348)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
at org.openide.util.Mutex.readAccess(Mutex.java:322)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:345)
at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:462)
at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
java.lang.ClassNotFoundException: GPanel
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1474)
at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:98)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:530)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:348)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
at org.openide.util.Mutex.readAccess(Mutex.java:322)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:345)
at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:462)
at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
java.lang.ClassNotFoundException: GPanel
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1474)
at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:98)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:718)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:850)
at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:994)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:530)
at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:312)
at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:348)
at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
at org.openide.util.Mutex.readAccess(Mutex.java:322)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:345)
at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:462)
at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
我在这里想念什么?