| Summary: | NPE while parsing dialog with custom content pane | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Missing name <fatalbender> | ||||
| Component: | WindowBuilder | Assignee: | Konstantin Scheglov <Konstantin.Scheglov> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Konstantin.Scheglov | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Missing name
Created attachment 199988 [details]
Report generated by WB. Contains source on which bug can be reproduced.
This is unsupported code style. WindowBuilder does not understand that setContentPane() causes returning different result from getContentPane(). We don't have plans to fix this. Try to generate new JFrame using wizard with "advanced" template, and configure Swing | Code Generation to use "initComponents" method. Then drop GroupLayout and see how code should look like to be understood by WindowBuilder. It seems i expecting too much from WB. Of course it can't do magic and parse whatever human wrote.
Generally, the bug itself is not a big problem. In my project custom content pane used only for tweaking of dialog appearance. Approach "comment line -> use WB designer -> uncomment line" is quite acceptable.
The only thing that really needed here is some friendly message about setContentPane. "Go to problem" button sends us to last line of code in initializer, not to "setContentPane(new JPanel())". I was dissapointed with this ("What am i doing wrong?") and spent some time on cutting parts of real-life dialog to discover problem line.
Unfortunately sometimes exception like this is really "exception", i.e. something what is not expected by WindowBuilder, and having support for identifying such cases is not easier than adding support for it. OK, I have one idea how to solve this. Fixed in trunk. |