JTabbedPane, how can a tab switch to another tab?

I have a JTabbedPane with a few tabs. Each tab consists of a class extending JPanel. If a certain action is performed on on of the tabs, the view should switch to another tab. How can this be done? I know about the method setSelectedComponent in the JTabbedPane class. But since the tab doesn't know about this, how can I use it?

Actually, the solution was dead simple. All I had to do was give the constructor of the class/tab a reference to the JTabbedPanel instance so it can call setSelectedIndex on it.
It works now, thanks anyway.

Similar Messages

  • How to prevent video playback from getting paused when switching to another tab on Firefox for Android?

    In Firefox for Android 27.0, if you play video in one tab and while it's playing you switch to another tab, the video gets paused. I want the video to continue to play while I'm viewing another tab (so I can at least hear its sound!).
    How can I do that?
    How can I prevent Firefox for Android from pausing video playback when switching to another tab?
    Thank you very much.

    Hi hamid_ss,
    Currently Firefox for Android does this by default with embedded players. Some sites go automatically to full screen too which may be what you are running into. Try it.

  • Whenever I have a pdf document open, and then switch to another tab to view another webpage, the scrolling function on the touchpad will not work. This seems to be a glitch with Mozilla, according to Dell. How do I fix this?

    When I open a pdf document (like an E-version of a newspaper) in Mozilla and then switch to another tab to view another webpage, I am unable to use the scrolling function on the touchpad. I have to use the up and down arrows to get other pages to scroll. When I close that pdf document, everything works fine. I talked with customer support with Dell, and he said it was probably a glitch with Mozilla. So I tried to do the same thing on IE, and there was no problem scrolling with the touchpad while a pdf document was open on another tab. I would like to get a fix for this so I don't have to keep closing open pdf documents in order to scroll with the touchpad while on other tabs. Thank you

    Hi elliezzz,
    If you are having issues with your iPhone not being recognized by iTunes, you may find the following article helpful:
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/ts1591
    Regards,
    - Brenden

  • How can Teststand have Switch Executive dynamicall​y change a route.

    I have created routes in Switch Executive and when I try to connect these routes thru Teststand via Action Properties under the Switching Tab.  I get an error saying:
    Details:A reserved for routing channel required for connecting this route is already in use by another route.(Error = -29031) [Error Code: -17500, Operation Failed.]
    I am trying to connect two different routes by the following syntax in the "Routes to Connect"  section:
    "Route1 & Route2"
    It seems that in Switch Executive Route1 and Route2 are both using the same reserved for routing paths.  For example:
    Route1:      [C0->MatrixA/r1->C2]
    Route2:      [C1->MatrixA/r1->C5]
    So my question is then...How can Teststand make Switch Executive change the route path?  I have r0, r1, r2, and r3 set as reserved for routing.  Thanks for your help.

    Thanks for your help.
    For situation 1: 
    When I use this method Switch Executive dynamically chooses a route but its always the same route.   What I need to do is have a set of pins that use only one route and another set of pins that uses a different set of routes.  You can think of it as c1 is one lead of a multimeter and c2 is the other lead.  I need to be able to connect c1 on any other column besides c2 and also c2 to be able to connect to any other pin besides c1.  Since in Teststand I need to connect c1 and c2 simultaneously as a step I get an error because both are trying to use the same route.
    Also when I change the route from: 
                                                      ​        channelA->matrix/r0->channelB
                                                      ​   to: channelA->matrix/r1->channelB,
    then when I save and close Switch Executive and I reopen it the channels automatically routes itself back to channelA->matrix/r0->channelB.
    Is there any way that I can save these routes to my configured route?

  • When I am on a Youtube video that is running and I want to switch to another tab, the Ctrl+ tab number does not work, is that intended functionality?

    When I am on a Youtube video that is running and I want to switch to another tab, the Ctrl+<tab number> does not work, is that intended functionality?

    This can happen when the video player (Flash plugin) has the focus.
    In that case the plugin consumes all the key presses.
    You will have to click with the mouse elsewhere on the page or in the user interface to make keyboard shortcuts work.

  • Audio stream stops when I switch to another tab in Safari

    I've got this radio station website which links to a live stream so you can hear the station online. It worked fine a couple of weeks ago, on my Powerbook G4 running 10.4.9. Then my Powerbook died.
    Enter my new MacBook Pro, still running 10.4.9. I try to listen to the same station, but everytime I start the stream, then switch to another tab to browse the internet, the audio stream stops.
    BTW, the audio stream behaves properly when I use Firefox. Is there a reason why Safari can't keep on playing the audio stream when it's not in the active tab? Or have I got a bad configuration?
    Many thanks, as always.

    Nah, forget it; I just remembered what really used to happen (which still happens):
    I used to open a new Safari window (not a new tab), open the radio stream in that new window, then switch to my previous Safari window with all my tabs. Then it works.
    For some reason, I don't have to do this (i.e. open two different windows as opposed to two tabs) in Firefox.
    I really like and prefer Safari to most browsers, but I have to admit, it's rather flaky in a number of ways. This is one of them.

  • How can I stop from closing all tabs...it says close 2 tabs...I don't want to close all tabs maybe just one

    How can I stop from closing all tabs. When it says do you want to close 2 tabs...what if I only want to close one?

    My workaround for this is to set up a smart playlist. I hope this is another one of the issues that gets cleard up when Apple eventually releases an 11.1.1 update.

  • How can i import contacts from another AIM account to this new one

    If you reference my last ichat question, you will see that I have had serious problems and had to create a new account.
    How can I import contacts from another AIM account to this new one??

    Hi,
    Use AIM for Mac and use the Export and Import features.
    Other than that it is a question on making sure every Single Buddy has more than just their Screen name in the IChat Address Card so it is added to the Address Book and dragging them back from there
    9:08 PM Thursday; February 7, 2008

  • You changed the order of the menu for "Open in a new window" or "Open in new Tab", How can I change it back? Or how can I omit any reference to tabs? I do not use them at all.

    You changed the order of the menu for "Open in a new window" or "Open in new Tab", How can I change it back? Or how can I omit any reference to tabs? I do not use them at all.

    You can use the Menu Editor add-on to rearrange or remove menu items - https://addons.mozilla.org/firefox/addon/menu-editor

  • Telling quicktime to stop playing if switched to another tab or browser?

    Hey Everyone
    Ok say i have a movie on a web page which is playing, and the user switches to another tab or browser window, is there anyway to tell quicktime to stop playing if this happens?
    Thanks for any help

    No.
    Unless the browser has that feature.

  • If I open a PDF doc in a new tab and then try and close the tab with ctrl-w it will try and close all tabs unless I switch to another tab and back again.

    Running Firefox beta and Adobe Acrobat 10. If I open a PDF document in a new tab, say http://support.avaya.com/css/P8/documents/100146419, and then try and close the tab using ctrl-w, I get the message warning me about closing all tabs. If I switch to another tab and then back to the PDF document and then hit ctrl-w, it will just close that one tab and not all tabs.
    Cheers.

    I've just been playing around and I set dom.ipc.plugins.enabled to true and now it closes the PDF document but not the tab. I have to do ctrl-w again to close the tab. However, leaving that set to true ruins the scroll mouse functionality as Acroread seems to want it all to itself.

  • HT4994 MY IPHONE IS NOT A SIM FREE HOW CAN I USE IT IN ANOTHER COUNTRY?

    MY IPHONE IS NOT A SIM FREE HOW CAN I USE IT IN ANOTHER COUNTRY?

    Apple can do nothing. As Tim said, only the carrier to whom the iPhone is locked can authorize unlocking. You must contact that carrier.
    Regards.

  • How can I have multiple WINDOWS (NOT tabs) with INDEPENDENT content?

    How can I have multiple '''windows''' (''not ''tabs) with '''independent''' content?
    I used to be able to open separate windows with Firefox, and the content could be completely different in each window. No matter what I did in any window, no OTHER window open at the time, nor any of the content therein, was affected. This is no longer the case and it is extremely frustrating for me.
    I do ''not ''like tabs and do not use them. I prefer multiple windows plus I am so used to using them, for so many years now! But with v9.0.1 I suddenly can no longer do what I've always done with my browser without this aggravating problem constantly reminding me that I can't have what I want in firefox anymore.
    Or can I? Does anyone have a solution I don't realize exists?
    Thanks,
    Sowelu

    AppleScriptObjC can use pretty much everything in the Cocoa API, so yes, it is possible.
    Note that a view is not the same as a window, and a window can have multiple views. There are also many ways to implement "tabs";  take a look at some of Apple's applications - they use various mixtures of toolbars, checkboxes, and radio buttons, for example.  An application such as this will be a lot more involved than what you have done so far though, using custom classes and subclassing existing ones, so be prepared to do a lot of reading and researching.

  • How can I use Bluetooth with another devices?

    How can I use Bluetooth with another devices?

    You can set up your FaceTime account in Settings > FaceTime.

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

Maybe you are looking for