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.
Product Version = NetBeans IDE 7.4 (Build 201310111528) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0_25 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Just tried to open a Swing-GUI-Form (JFrame), but it doesn't open! When clicking on the "Design"-Button next to the "Source" and "History"-Button, you shortly see the GUI-Builder loading (a light-gray space with text "loading..."), but then it cancels and just shows the source-code Tab. Details about the form: - It uses Free-Layout/GroupLayout, except from two panels using GridBagLayout - There are many buttons which don't have default size, but are horizontally resizable - Inside of the two Panels with GridBagLayout, there are a custom components calles "ImageLabel" (but the IDE-Log does not show any of my classes in the stacktrace, so I don't assume it's my class which causes the error) The IDE-Log says something about a NullPointerException at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.getComponentCount Note: When opening the same file with NetBeans 7.2.1, it works fine
Created attachment 142194 [details] IDE log
The exception in the log is the bug. The layout of some container was not initialized properly (which may or may not be a significant problem), but the loading should not fail on that. Due to this exception the original problem could not be even reported and the whole form loading crashed. Could you attach here the GUI form where it fails so we have a sample for verification? And also a sense how frequent issue this can be? Thanks.
Created attachment 142229 [details] The GUI-Form-XML-File wich crashed This is the GUI-XML-File which causes the FormBuilder to Crash. It is called "StartFenster" ("Fenster" is the german word for "Frame"), and it contains the main menu of my application (which is a little card-game, by the way). As already said, it contains many buttons and labels, two custom components of class "ImageLabel", which are both embedded in Panels with GridBagLayout.
In the attached form there is some problem with the reusable.ui.navc.NavigationController custom component (in the form it is saved as an empty container, subclass of JLayeredPane). Due to this problem the layout of the container is not initialized and because of the bug the loading crashes without reporting the problem. I could reproduce it because I don't have reusable.ui.navc.NavigationController class - so for me the problem was that this class was missing. I'd guess it is most likely also the case for the reporter - so please make sure this class is available on classpath, either in a JAR or if as a source in a project then make sure it is compiled (the project built). I've created a similar custom subclass of JLayeredPane and could open the form. Let me know this workaround does not help. Fix: http://hg.netbeans.org/jet-main/rev/a371db95435a The problem with this bug is that it effectively hides reporting of form loading problems if there is some problem with a custom container (like class not found) so the user does not know what is wrong. So would be nice to have it fixed in a 7.4 patch (if there is some more to go). Luckily it does not affect reporting errors about components that are not containers which is much more frequent case.
So, I rebuilt the Project in case that the class reusable.ui.navc.NavigationController was not compiled, but this didn't resolve the problem either. I'm quite sure there's no error inside of my NavigationController class cause if I open the same project in NetBeans 7.2.1, opening the form works fine. (Additionaly I'm using the same class NavigationController in some other projects, also embedded inside a form like in this one and it works). If you want me to upload reusable.ui.navc.NavigationController, I could do this, but it depends on various other classes (not only NavigationControllerDelegate and NavigationBar, but also a complete Animtion-Framework)
Changing back to fixed. What remains is only to find a workaround for 7.4 - going to e-mail with the reporter separately.
*** Bug 238981 has been marked as a duplicate of this bug. ***
Fix transplanted to release74 branch: http://hg.netbeans.org/releases/rev/4b456df6499b
Integrated into 'releases/release74', will be available in build *201312052201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/4b456df6499b User: Tomas Pavek <tpavek@netbeans.org> Log: #238382: if layout initialization failed (e.g. unknown container class) don't ask LayoutSupportManager for anything, also make old JLayeredPane support load as null layout even if container can't be created (transplanted from a371db95435abb203a514d3d72fc6bf54bf2cd28)
*** Bug 237215 has been marked as a duplicate of this bug. ***