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.

Bug 162455 - Form/Swing editor not calling .pack() on "Other Components"
Summary: Form/Swing editor not calling .pack() on "Other Components"
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-11 19:38 UTC by fommil
Modified: 2009-05-25 20:57 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fommil 2009-04-11 19:38:09 UTC
I used the graphical Java Form/Swing editor to create a form with a button that opens up a JDialog  as modal popup when clicked. The JDialog is 
categorised under the "Other Components" Navigator menu. However, observing the generated code... pack() is never called on the JDialog and there does 
not appear to be any way to tell the popup to be centered under the mouse, or indeed to call .setLocationRelativeTo(this).

Workaround is to manually call jDialog1.pack() and jDialog1.setLocationRelativeTo(this) in the form's constructor. The preferred solution would be for:-

- pack() to be called appropriately
- an option to call setLocationRelativeTo()

so that all of this is done in the initComponents() method.

If you want to see an example, apply patch "java.editor-excluder-update-2.diff" from bug 125060 to main-golden and have a look in the file CodeCompletionPanel in java.editor's org.netbeans.modules.java.editor.options package. Hopefully this will be a part of main-golden within a week.