tags:

views:

342

answers:

2

hi ,

as i said in title i wanna do dynamic jtabbedpane .. for example ;

JTabbedPane tabbedPane = new JTabbedPane();
ImageIcon icon = createImageIcon("images/middle.gif");
JComponent panel1 = makeTextPanel("Panel #1");
tabbedPane.addTab("Tab 1", icon, panel1,"Does nothing");

i can dynamically adding tabs to tabbedpane container.But problem is how can i design panels that i want to add tabbedpane.Its too hard to make from code behind.I can only add a label thats it :) Is there any way to Design my panel then add it Jtabbedpane from code behind ? ..

+1  A: 

Why is it more difficult than dynamically adding tabs? Are you perhaps not using the right sort of LayoutManager? Generally, if you choose a good layout manager configuring panels will be much easier. I use the JGoodies Forms, and I heard good things about MigLayout.

omerkudat
+1 for MiGLayout - if you are still using JGoodies Forms, I definitely recommend that you try MiG out...
Kevin Day
A: 

If you are using some sort of swing GUI designer then create a class (design the gui) for the panel that you want to add to the tabbed pane, and then to dynamicaly add that panel to the tabbed pane just go tabbedpane.addTab("Something",null,new MyPredesignedPanel(),"Something");

maybe I have misunderstood the question

instanceofTom