This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setting a specific tab of JtabbedPane to be visible  RSS feed

 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a JTabbedPane that has three tabs.Now whenever I open my application I find the first tab visible,but I use the same JFrame for all operatoins.I have one tab "view" one as "Options"& the other as "Help".Now I have a System Tray Icon & when the user clicks on options I will display the the same JFrame containing the JtabbedPane but the "Options" tab should be selected now, instead of "View" tab.
Please reply this hopefully Nate.Sorry for I haven't gone thro' the API thoroughly.
Happy middliong with java.
Netharam. :roll:
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTabbedPane has two methods which may be of use to you...


if you want to select the tab by referring to the component inside it ( the "options" panel ), or
if you know the index of the tab that holds the "options" panel.

You can find the API's online here for your viewing or downloading pleasure...

-Nate
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!