views:

584

answers:

1

I'm a fairly experienced Java user, but I've just started trying to use NetBeans to build a GUI. Previously I coded GUIs by hand, but this is a bit of a bigger project.

Anyways, I have a Vector in my model (MVC design), and I want to make the list populate with elements in my vector. I know how I'd do this by hand- I'd initiate the list like so:

JList list = new JList(model.getVector());

But the problem is that I can't edit the part of the code that netbeans uses to initialize components.... So I was wondering how I would go about using the IDE to grab this vector in its initiation....I assume it has something to do with editing the properties, but I couldn't see anything entirely promising.

Thanks!

+1  A: 

Read the suggestion by mmyers; I googled for "custom creation code" and figured it out-

I right clicked the list in the Design view, clicked on "Customize Code," and on the initialization part, I changed the dropdownbox to "custom creation" and edited the code by hand :P

RyanCacophony