Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

Adding tabd to JTabbedPane Dynamically

Thread view: 
Nandu - 16 Jan 2006 19:24 GMT
Hi Java Gurus
 I am adding JPanels to the JTabbedPane dynamically.  Initally i have
one tab pane. when i am adding the second tab pane using the following
code

  // name is String type ie., Name of the tab
  // japnel_area is the JPanel i am adding to
  //JTabbedPane dynamically

 tabbedPane.add(name, jpanel_area);
 tabbedPane.revalidate();

its working fine when i am adding the second tab pane.. but when i add
the third tab pane, the second is replaced by the third.. i am not able
to figure out whats happening.. please any one help me  to figure out
James Westby - 16 Jan 2006 20:16 GMT
> Hi Java Gurus
>   I am adding JPanels to the JTabbedPane dynamically.  Initally i have
[quoted text clipped - 11 lines]
> the third tab pane, the second is replaced by the third.. i am not able
> to figure out whats happening.. please any one help me  to figure out

Have you tried addTab(String, Component) instead?

James
Nandu - 16 Jan 2006 20:29 GMT
James
 i even tried as you said  but its the same thing. but when i add
jpanel_area to JScrollPane and then add JScrollPane to the tab,, the
new tabs are coming but the contents of the last tab only remain..
remaining tabs are going blank..any suggestion regarding these
IchBin - 16 Jan 2006 20:46 GMT
> James
>   i even tried as you said  but its the same thing. but when i add
> jpanel_area to JScrollPane and then add JScrollPane to the tab,, the
> new tabs are coming but the contents of the last tab only remain..
> remaining tabs are going blank..any suggestion regarding these

I have nested tabs on my frame and here is a sample call I use to add a
new tab.

detailTabbedPane.addTab(TABLABEL_ARININFP, null, new
JScrollPane(buildTabTable(type)),TOOLTIP_ARININFP);

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Nandu - 16 Jan 2006 20:51 GMT
james

it worked for me... thanx for you suggestions
IchBin - 16 Jan 2006 20:52 GMT
>> James
>>   i even tried as you said  but its the same thing. but when i add
[quoted text clipped - 7 lines]
> detailTabbedPane.addTab(TABLABEL_ARININFP, null, new
> JScrollPane(buildTabTable(type)),TOOLTIP_ARININFP);

Sorry.. I would recommend just step debug thru the code to see what it
is actually doing.

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.