Results 1 to 3 of 3
Thread: Adding Tabs to JTabbedPane
- 11-14-2007, 02:37 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 6
- Rep Power
- 0
Adding Tabs to JTabbedPane
Hello! I'm mildly new at Java. I've been using it for a little over a year now, but I just started learning the GUI stuff. I'm experimenting with JTabbedPane at the moment. I'm trying to add a new tab to my JTabbedPane if the user clicks a certain button. I have the tab adding perfectly fine, but my question is this: Is it possible for me to bring the tab to the front as soon as it is added? If there are several other tabs already in the pane, I want the new tab to show up in front immediately, without the user having to go and click on the tab.
I was looking at the Java API and found quite a few methods pertaining to focus, but I didn't really understand it. Is this what I need to use? Or is there something else?
Thank you in advance!
Blackstone
- 11-14-2007, 08:41 AM #2
Java Code:tabbedPane.addTab(tabName, component); int count = tabbedPane.getTabCount(); tabbedPane.setSelectedIndex(count-1);
- 11-14-2007, 03:15 PM #3
Member
- Join Date
- Nov 2007
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Adding information to a JTable in a JTabbedPane
By bigpappatrader in forum AWT / SwingReplies: 0Last Post: 12-05-2007, 07:09 AM -
help drag and drop in JTabbedPane
By RO86 in forum AWT / SwingReplies: 0Last Post: 08-14-2007, 01:22 PM -
Help with JTabbedPane
By lenny in forum SWT / JFaceReplies: 1Last Post: 08-07-2007, 06:18 AM -
Same component on all JTabbedPane
By java_novice in forum AWT / SwingReplies: 4Last Post: 08-06-2007, 09:09 AM -
resize tabs in jtabbedpane
By osval in forum New To JavaReplies: 1Last Post: 08-02-2007, 03:02 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks