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 141667 - JComboBox's default model generation can't be disabled
Summary: JComboBox's default model generation can't be disabled
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: 2008-07-25 12:23 UTC by janzak
Modified: 2008-07-25 14:01 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 janzak 2008-07-25 12:23:28 UTC
When new JComboBox (and probably JList, too) is placed on a JPanel, NetBean's GUI designer automatically generates
setModel method call with setting component's model to a dummy default model like "Item 1, Item 2, ...".

This behavior can't be changed somehow. It's very inconvenient, if you are developing application, which reads all
models for all comboboxes from DB in runtime, because you have to manually delete this unnecessary model's setting just
after you have placed new JComboBox on the panel. And it's a blocker issue, if you have specialized JComboBox's
subclass, which can't work with string array model, because it throws ClassCastException and prevents you from placing
such component on the panel even.

My enhancement request is to have an option to disable generation of this default component's model.
Comment 1 Tomas Pavek 2008-07-25 14:01:07 UTC
Maybe one global option whether to set the default values to components that are usually filled dynamically (based on 
a model - combobox, list, table), or rather appear empty (textfield).