identical JPanels, repetitive  
Author Message
thufir





PostPosted: 2008-6-20 17:22:00 Top

java-programmer, identical JPanels, repetitive
I need to make a tabbed pane with four tabs, each pane shows text and
images from a List<Room> collection.

I can manually create the four tabs from the netbeans GUI builder, and
maybe use some copy paste so that the four tabs are similar if not
identical.

Staying within the GUI builder, how would four identical JPanel's, which
make up the tabs for a JTabbedPane, get created?

Could I somehow make a JList show as tabs?


thanks,

Thufir
 
RedGrittyBrick





PostPosted: 2008-6-20 18:05:00 Top

java-programmer >> identical JPanels, repetitive thufir wrote:
> I need to make a tabbed pane with four tabs, each pane shows text and
> images from a List<Room> collection.
>
> I can manually create the four tabs from the netbeans GUI builder, and
> maybe use some copy paste so that the four tabs are similar if not
> identical.
>
> Staying within the GUI builder, how would four identical JPanel's, which
> make up the tabs for a JTabbedPane, get created?

I think you need to stop using the GUI builder, it seems to be hindering
you.

>
> Could I somehow make a JList show as tabs?
>

JList<SomeThing> list;
JTabbedPane pane;
...
for (SomeThing thing: list) {
pane.add(new MyComponent(thing));
}


Perhaps you need a model class (as in MVC) hooked up to your JTabbedPane
so that additions, deletions and changes to the JList get reflected in
the JTabbedPane?

--
RGB