Javascript bug when switching tabs

Hello,
I'm developing a simple web site with an image slideshow on the front page. The slideshow is powered by javascript and are using javascript's "setTimeout" function to toggle between images with a jQuery animation. However, when I switch to another tab and wait for a while, then switch back, it seems like all animations that should have been run in the background has been queued up and then runs simultaneously as soon as I switch back to the original tab. Basically it freaks out for a few seconds when all stacked up animations are run, and then it goes back to the normal behaviour.
Is this a bug or a feature? And if it's a feature, how would you suggest that I code my javascript to avoid this problem?

See Additional Notes -section of JQuery's animate-function documentation
Because of the nature of requestAnimationFrame(), you should never queue animations using a setInterval or setTimeout loop. In order to preserve CPU resources, browsers that support requestAnimationFrame will not update animations when the window/tab is not displayed.
'''If you continue to queue animations via setInterval or setTimeout while animation is paused, all of the queued animations will begin playing when the window/tab regains focus.'''
To avoid this potential problem, use the callback of your last animation in the loop, or append a function to the elements .queue() to set the timeout to start the next animation.
Source: http://api.jquery.com/animate/#notes-0

Similar Messages

  • After update to Firefox 25, tabs will "go back" 2 to 3 pages, when switching tabs or exiting full screen.

    It happens most frequently when exiting full screen from a video. i.e. youtube, dailymotion, nbc.com - any site with embedded video players.
    When exiting full screen, the page skips backwards 2 to 3 pages. And no, I'm not clicking related videos while in full screen the whole time - this is while initiating full screen and exiting full screen, all from the same video page.
    This happens less frequently when switching tabs - but if I switch to another tab, then back, the first tab will load the page I was on 2 pages ago.
    More info: When this happens, the "forward arrow" is greyed out and the page that that loads is on the "back arrow" list twice - further down the list where it should be, as well as at the very top of the list, as though I had clicked on a link to that page.
    This all started immediately upon restarting Firefox after updating to version 25 - no other changes have been made to my computer.

    Thanks for the canned responses, but you guys are way off.
    More information: It's related to HTML5 - whenever I fullscreen an HTML5 video, Firefox skips backwards to the most recent HTML5 video before that one, when exiting fullscreen. This last time, it skipped backwards past 4 pages that had no HTML5 content at all, to the one that did.

  • IPhone 4S Safari freezes when switching tabs

    Hi.
    Mobile Safari in my iPhone 4S freezes when switching tabs.  This does not happen every time Safari is running, but it happened one too many already.  Safari freezes even if I only have one tab and wanted to create a new one.  The app would usually freeze while doing the switch, tho it also froze just before the tabs switch.  Has anyone experienced the same?  Please help.  Thank you.   

    User troubleshooting after a reset is a restore. First from a backup and if that doesn't help, then as a new device. Remember a restore will delete data from the phone. Make sure you have everything backed up and synced to the computer before attempting the restore. If that does not help, make an appointment with the Apple Genius Bar to check for hardware faults.

  • Firefox unmaximizes itself when switching tabs in task bar

    When switching tabs using the windows taskbar during an extended online session spanning multiple tabs and windows, the window will unmaximize itself. Switching tabs using the physical tab works correctly. This only occurs with the "Show tabs preview in the Windows Taskbar" opton enabled. Closing all open firefox windows and restarting firefox is the only fix I have found.

    Hi achenbachs630420,
    This is expected behavior for the Windows 7 operating system. However when I have Firefox in fill screen mode for a window and hover over the taskbar the preview will show up and the full screen will remain, and I have the same feature selected, weird?
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Dreamweaver 6.1 - JavaScript error when switching between open tabs

    When switching between open tabs a sequence of javascript
    errors occurs. I had not used Dreamweaver for about 2 weeks, and
    last time I used it with no problems.
    I have tried uninstalling it, OKing removal of all files when
    asked, re-installing it and updating with dwmx61_updater.exe, but I
    still get the same errors.
    This has rendered the software virtually unuseable, so any
    help would be greatly appreciated, as I'm working to a
    rapidly-approaching deadline.
    "While executing Browse_Back enabled in toolbars.xml, a
    JavaScript error occurred"
    followed by
    "While executing Browse_Forward enabled in toolbars.xml, a
    JavaScript error occurred"
    followed by
    "While executing Browse_Stop enabled in toolbars.xml, a
    JavaScript error occurred"
    The relevant code seems to be :
    <!-- Browser nav toolbar -->
    <toolbar id="Browser_Toolbar" platform="win"
    label="Browser Navigation" container="document"
    initiallyVisible="false">
    <button id="Browse_Back"
    image="Toolbars/images/MM/back.gif"
    disabledImage="Toolbars/images/MM/back_dis.gif"
    tooltip="Back"
    label="Back"
    enabled="dw.getDocumentDOM().browser.isCmdEnabled('back')"
    command="dw.getDocumentDOM().browser.backPage()"
    update="onEveryIdle"/>
    <button id="Browse_Forward"
    image="Toolbars/images/MM/forward.gif"
    disabledImage="Toolbars/images/MM/forward_dis.gif"
    tooltip="Forward"
    label="Forward"
    enabled="dw.getDocumentDOM().browser.isCmdEnabled('forward')"
    command="dw.getDocumentDOM().browser.forwardPage()"
    update="onEveryIdle"/>
    <button id="Browse_Stop"
    image="Toolbars/images/MM/stop.gif"
    disabledImage="Toolbars/images/MM/stop_dis.gif"
    tooltip="Stop"
    label="Stop"
    enabled="dw.getDocumentDOM().browser.getPageBusy()"
    command="dw.getDocumentDOM().browser.stopPage()"
    update="onBrowserPageBusyChange"/>
    <button id="Browse_Refresh"
    image="Toolbars/images/MM/browserRefresh.gif"
    tooltip="Refresh"
    label="Refresh"
    enabled="true"
    command="dw.getDocumentDOM().browser.refreshPage()"/>
    presumably the next error is caused by the previous ones
    failing :
    "While executing getCurrentValue in AddressURL.htm, a
    JavaScript error occurred"
    the relevan tcode :
    function getCurrentValue()
    var dom = dw.getDocumentDOM();
    var value = dom.browser.getURL();
    if (value && value.length)
    //check if is it not a temp file
    //extract the tail of the url
    var filename = value;
    var slashIndex = filename.lastIndexOf("/");
    filename = filename.substring(slashIndex+1);
    var tempIndex = filename.indexOf("TMP");
    if (tempIndex != 0)
    addRecentAddress(value);
    return value;

    You can try this simple fix -
    Quit DW.
    Find this folder -
    C:\Documents and Settings\<username>\Application
    Data\Macromedia\Dreamweaver
    8\Configuration\WinFileCache-*.dat
    (these folders are normally hidden - you may have to use
    Explorer > Tools >
    Folder Options to unhide them)
    and delete it.
    Restart DW. Works better?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "earthdoctor" <[email protected]> wrote in
    message
    news:[email protected]...
    > When switching between open tabs a sequence of
    javascript errors occurs. I
    > had
    > not used Dreamweaver for about 2 weeks, and last time I
    used it with no
    > problems.
    >
    > I have tried uninstalling it, OKing removal of all files
    when asked,
    > re-installing it and updating with dwmx61_updater.exe,
    but I still get the
    > same
    > errors.
    >
    > This has rendered the software virtually unuseable, so
    any help would be
    > greatly appreciated, as I'm working to a
    rapidly-approaching deadline.
    >
    >
    > "While executing Browse_Back enabled in toolbars.xml, a
    JavaScript error
    > occurred"
    > followed by
    > "While executing Browse_Forward enabled in toolbars.xml,
    a JavaScript
    > error
    > occurred"
    > followed by
    > "While executing Browse_Stop enabled in toolbars.xml, a
    JavaScript error
    > occurred"
    >
    > The relevant code seems to be :
    >
    > <!-- Browser nav toolbar -->
    >
    > <toolbar id="Browser_Toolbar" platform="win"
    label="Browser
    > Navigation"
    > container="document" initiallyVisible="false">
    >
    > <button id="Browse_Back"
    > image="Toolbars/images/MM/back.gif"
    > disabledImage="Toolbars/images/MM/back_dis.gif"
    > tooltip="Back"
    > label="Back"
    >
    enabled="dw.getDocumentDOM().browser.isCmdEnabled('back')"
    > command="dw.getDocumentDOM().browser.backPage()"
    > update="onEveryIdle"/>
    >
    > <button id="Browse_Forward"
    > image="Toolbars/images/MM/forward.gif"
    > disabledImage="Toolbars/images/MM/forward_dis.gif"
    > tooltip="Forward"
    > label="Forward"
    >
    enabled="dw.getDocumentDOM().browser.isCmdEnabled('forward')"
    > command="dw.getDocumentDOM().browser.forwardPage()"
    > update="onEveryIdle"/>
    >
    > <button id="Browse_Stop"
    > image="Toolbars/images/MM/stop.gif"
    > disabledImage="Toolbars/images/MM/stop_dis.gif"
    > tooltip="Stop"
    > label="Stop"
    > enabled="dw.getDocumentDOM().browser.getPageBusy()"
    > command="dw.getDocumentDOM().browser.stopPage()"
    > update="onBrowserPageBusyChange"/>
    >
    > <button id="Browse_Refresh"
    > image="Toolbars/images/MM/browserRefresh.gif"
    > tooltip="Refresh"
    > label="Refresh"
    > enabled="true"
    > command="dw.getDocumentDOM().browser.refreshPage()"/>
    >
    >
    >
    > presumably the next error is caused by the previous ones
    failing :
    >
    > "While executing getCurrentValue in AddressURL.htm, a
    JavaScript error
    > occurred"
    > the relevan tcode :
    >
    >
    > function getCurrentValue()
    > {
    > var dom = dw.getDocumentDOM();
    > var value = dom.browser.getURL();
    > if (value && value.length)
    > {
    > //check if is it not a temp file
    > //extract the tail of the url
    > var filename = value;
    > var slashIndex = filename.lastIndexOf("/");
    > filename = filename.substring(slashIndex+1);
    > var tempIndex = filename.indexOf("TMP");
    > if (tempIndex != 0)
    > {
    > addRecentAddress(value);
    > }
    > }
    > return value;
    > }
    >
    >

  • Call a Function when switching tabs in TabbedPanel

    I am using Allan Jardine's DataTables javascript library , along with the Spry TabbedPanel. I have one table in each of a number of Tabs. The table in the tab opened by default (or if I use ShowPanel()) is fine. However, if I switch tabs, the other tables, which were hiden when the page was opened,  are not correctly initialised, and don't display correctly. Doing anything that causes the displayed table to be redrawn results in the table displaying correctly, and from then on I can switch tabs and the tables are fine.
    DataTables has an API function fnDraw(), which will cause a specified table to be redrawn. Is it possible to cause TabbedPanel to call a user specified function when the tabs are swapped, so I can call fnDraw()? I think this woiuld solve my problem.
    Thanks
    Ron

    Thanks.
    But I found a simpler way. At the end of the jQuery(document).ready(function(), which initialises the datatables, I added
    var ret=TabbedPanels1.showPanel("expiredquotes");
    oTable2.fnDraw();
    var ret=TabbedPanels1.showPanel("confirmedquotes");
    oTable3.fnDraw();
    var ret=TabbedPanels1.showPanel("openquotes");
    Which opens each of the "other" tabs and redraws the respective DataTable while they are "visible". Then at the end I display the 'default' Tab. I only need to do this once, when the page is opened, after which the tables are correctly formatted.
    Regards
    Ron

  • Focus-requests when switching tabs in JTabbedPane

    I have a tabbed pane with a JTextArea in each tab. I would like to switch focus to the corresponding area each time I select a tab or create a new one. A ChangeListener can detect tab selections and call requestFocusInWindow() on the newly chosen tab's text area.
    For some reason, the focus only switches sporadically. Sometimes the caret appears to stay, sometimes it only blinks once, and sometimes it never appears. My friend's workaround is to call requestFocusInWindow() again after the setSelectedIndex() calls, along with a Thread.sleep() delay between them. Oddly, in my test application the delay and extra focus-request call are only necessary when creating tabs automatically, rather than through a button or shortcut key.
    Does the problem lie in separate thread access on the same objects? I tried using "synchronized" to no avail, but EventQueue.invokeLater() on the focus request worked. Unfortunately, neither the delay nor invokeLater worked in all situations in my real-world application. Might this be a Swing bug, or have I missed something?
    Feel free to tinker with my test application:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    /**Creates a tabbed pane with scrollable text areas in each tab.
    * Each time a tab is created or selected, the focus should switch to the
    * text area so that the cursor appears and the user can immediately type
    * in the area.
    public class FocusTest2 extends JFrame {
         private static JTabbedPane tabbedPane = null;
         private static JTextArea[] textAreas = new JTextArea[100];
         private static int textAreasIndex = 0;
         private static JButton newTabButton = null;
         /**Creates a FocusTest2 object and automatically creates several
          * tabs to demonstrate the focus switching.  A delay between creating
          * the new tab and switching focus to it is apparently necessary to
          * successfully switch the focus.  This delay does not seem to be
          * necessary when the user fires an action to create new tabs, though.
          * @param args
         public static void main(String[] args) {
              FocusTest2 focusTest = new FocusTest2();
              focusTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              focusTest.show();
              //Opens several tabs.
              for (int i = 0; i < 4; i++) {
                   try {
                        //adding the tab should automatically invoke setFocus()
                        //through the tabbed pane's ChangeListener, but for some
                        //reason the focus often doesn't switch or at least doesn't
                        //remain in the text area.  The workaround is to pause
                        //for a moment, then call setFocus() directly
                        addTabbedPaneTab();
                        //without this delay, the focus only switches sporadically to
                        //the text area
                        Thread.sleep(100);
                        setFocus();
                        //extra delay simply for the user to view the tab additions
                        Thread.sleep(1900);
                   } catch (InterruptedException e) {
         /**Adds a new tab, titling it according to the index of its text area.
          * Using "synchronized" here doesn't seem to solve the focus problem.
         public static void addTabbedPaneTab() {
              if (textAreasIndex < textAreas.length) { //ensure that array has room
                   textAreas[textAreasIndex] = new JTextArea();
                   //title text area with index number
                   tabbedPane.addTab(
                        textAreasIndex + "",
                        new JScrollPane(textAreas[textAreasIndex]));
                   tabbedPane.setSelectedIndex(textAreasIndex++);
         /**Constructs the tabbed pane interface.
         public FocusTest2() {
              setSize(300, 300);
              tabbedPane = new JTabbedPane();
              //Action to create new tabs
              Action newTabAction = new AbstractAction("New") {
                   public void actionPerformed(ActionEvent evt) {
                        addTabbedPaneTab();
              //in my real-world application, adding new tabs via a button successfully
              //shifted the focus, but doing so via the shortcut key did not;
              //both techniques work here, though
              newTabAction.putValue(
                   Action.ACCELERATOR_KEY,
                   KeyStroke.getKeyStroke("alt T"));
              newTabAction.putValue(Action.SHORT_DESCRIPTION, "New");
              newTabAction.putValue(Action.MNEMONIC_KEY, new Integer('T'));
              newTabButton = new JButton(newTabAction);
              Container container = getContentPane();
              container.add(tabbedPane, BorderLayout.CENTER);
              container.add(newTabButton, BorderLayout.SOUTH);
              //switch focus to the newly selected tab, including newly created ones
              tabbedPane.addChangeListener(new ChangeListener() {
                   public void stateChanged(ChangeEvent evt) {
                        //note that no delay is necessary for some reason
                        setFocus();
         /**Sets the focus onto the selected tab's text area.  The cursor should
          * blink so that the user can start typing immediately.  In tests without
          * the delay during the automatic tab creation in main(), the cursor
          * sometimes only blinked once in the text area.
         public static void setFocus() {
              if (tabbedPane == null) //make sure that the tabbed Pane is valid
                   return;
              int i = tabbedPane.getSelectedIndex();
              if (i < 0) //i returns -1 if nothing selected
                   return;
              int index = Integer.parseInt(tabbedPane.getTitleAt(i));
              textAreas[index].requestFocusInWindow();
    }

    Did you ever get everything figured out with this? I have a similar problem ... which I have working, but it seems like I had to use a bunch of hacks.
    I think the problem with the mouse clicks is because each event when you click the moues (mousePressed, mouseReleased, mouseClicked) causes the tab to switch, and also these methods are called twice for some reason - for a total of 8 events giving the tab the focus instead of your textarea.
    This works, but seems aweful hacky:
         class TabMouseListener extends MouseAdapter
              private boolean switched = false;
              public void mousePressed( MouseEvent e ) { checkPop( e ); }
              //public void mouseReleased( MouseEvent e ) { checkPop( e ); }
              //public void mouseClicked( MouseEvent e ) { checkPop( e ); }
              public void checkPop( MouseEvent e )
                   if( e.isPopupTrigger() )
                        mousex = e.getX();
                        mousey = e.getY();
                        int index = tabPane.indexAtLocation( mousex, mousey );
                        if( index == -1 ) return;
                        tabMenu.show( tabPane, mousex, mousey );
                   else {
                        if( !switched )
                             switched = true;
                             e.consume();
                             int index = tabPane.indexAtLocation( e.getX(), e.getY() );
                             if( index != -1 )
                                  tabPane.setSelectedIndex( index );
                                  TabFramePanel panel = (TabFramePanel)tabPane.getComponentAt( index );
                                  if( panel != null ) panel.getInputComponent().requestFocus();
                        else {
                             switched = false;
                             TabFramePanel panel = (TabFramePanel)tabPane.getSelectedComponent();
                             if( panel != null ) panel.getInputComponent().requestFocus();
         }Do you know of a better way yet?
    Adam

  • Tabs and pages not drawn when switching tabs.

    When switching between tabs or opening new tabs, the tab and the page are not drawn. But if I scroll down the page is drawn.
    This doesn't happen always. It happens randomly.
    Here's some sample sample images:
    https://dl.dropboxusercontent.com/u/14279386/imghost/tabrender/1.png
    https://dl.dropboxusercontent.com/u/14279386/imghost/tabrender/2.png
    I've been having this problem since a few versions back.

    If it works in Safe Mode and in normal mode with all extensions (Firefox/Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    In Firefox Safe mode these changes are effective:
    *all extensions are disabled (about:addons)
    *default theme is used (no persona)
    *userChrome.css and userContent.css are ignored (chrome folder in profile folder)
    *default toolbar layout is used
    *JavaScript JIT compilers are disabled
    *hardware acceleration is disabled (Options > Advanced > General)
    *plugins are not affected
    *preferences are not affected

  • Refreshing when switching tabs

    Hi,
    I have created a webcenter site that has tabs used in iframes. What I would like to do is to refresh the bottom frame when a person switches tabs so the old data id removed. Does anyone know how to achieve this?
    Any help would be appreciated.
    -Joe

    What technology are you using? WebCenter Content with a Javascript frontend? Do you use JQuery or some other framework?
    Can you post the existing code that needs changing?

  • AIR app crashes when switching tabs

    Hi there:
    I posted in another forum about this, but it seems the issues
    aren't really related, so a recap:
    quote:
    Originally posted by:
    patrickcheatham
    I am trying to run an AIR app which _crashes_ as soon as it
    needs to access a file or files on the hard drive (via an HTML
    component). Sometimes it just crashes, sometimes I get an error
    that the app can't find Adobe AIR. I have followed most or all of
    the suggestions in
    this
    thread.
    Attached code is a crash report.
    Thanks!
    The app can be found
    here
    The crash report can be found
    here
    The crash report has WebKit all over it; interstingly, when a
    user reported installing the Safari 4 Beta recently, all crashing
    stopped (that doesn't really make sense to me, but OK).
    quote:
    Originally posted by:
    patrickcheatham
    I have further input on this:
    1) The crash occurs when the user switches tabs;
    specifically, when the user switches from a tab which does _not_
    contain an HTML component, to one which _does_ contain an HTML
    component. Said HTML component looks for local content.
    2) The crash occurs when the app tries to phone home to
    Adobe; this phoning home appears to occur during item 1 above
    _and/or_ when the app is launched.
    Any help from above or insight appreciated.
    Thanks,
    Patrick

    Hi Mirela:
    It may be that the issue is a non-issue with AIR 1.5.1
    (versus v1.5), so we'll see. Frustrating, nonetheless, especially
    since it is a sporadic issue.
    You can follow other users' experiences in the forum at
    panosalado.com.
    Thanks for taking the time to download it and try it out --
    and for the feedback. Good to hear a positive! :)
    Cheers,
    Patrick

  • EA1: BUG: View Table Data: Filter gets lost when switching tabs

    Hi,
    open a table, choose the data tab and enter a filter condition. The data is filtered.
    Bug is
    a) choose e.g. constraint tab for the same table and then again the data tab. Data remains filtered, but filter is not displayed
    b) pin the table, open another table, navigate back to the previous table. Data remains filtered, but filter is not displayed.
    Regards
    Stephan

    The issue was reported already and will probably be fixed in EA2...
    Regards,
    K.

  • JTabbedPane loosing focus when switching tabs

    When there are tiered JTabbedPanes and focus in one of the children and the tabbed is switched focus will go to the first component in the frame.
    Is there a work around to keep the focus at least on the jtabbedpane?
    Is this a know bug? anyone heard of this before?
    Googling: JTabbedPane focus didn't bring up anything helpful... is there something else I should be searching under?
    Here is an example:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    public class TabPaneTest extends JFrame {
        public TabPaneTest() {
            JButton focusStealer = new JButton("Look at me!");
            focusStealer.addFocusListener(new FocusListener() {
                public void focusGained(FocusEvent e) {
                    System.out.println("I TOOK FOCUS! W00t!");
                public void focusLost(FocusEvent e) {
                    //To change body of implemented methods use File | Settings | File Templates.
            JTabbedPane tabbedPane = createTabbedPane(0);
            getContentPane().add(focusStealer, BorderLayout.NORTH);
            getContentPane().add(tabbedPane, BorderLayout.CENTER);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(300, 200);
            setLocation(400, 200);
            setVisible(true);
        private JTabbedPane createTabbedPane(int deep) {
            deep++;
            JTabbedPane tabs = new JTabbedPane();
            for (int i = 0; i < 4; i++) {
                if (deep < 4) {
                    tabs.add(i + ":" + deep + " - Focus", createTabbedPane(deep));
                } else {
                    tabs.add(i + ":" + deep + " - Focus", new JTextField());
            return tabs;
        public static void main(String[] args) {
            new TabPaneTest();
    }

    When there are tiered JTabbedPanes and focus in one of the children and the tabbed is switched focus will go to the first component in the frame.
    Is there a work around to keep the focus at least on the jtabbedpane?
    Is this a know bug? anyone heard of this before?
    Googling: JTabbedPane focus didn't bring up anything helpful... is there something else I should be searching under?
    Here is an example:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    public class TabPaneTest extends JFrame {
        public TabPaneTest() {
            JButton focusStealer = new JButton("Look at me!");
            focusStealer.addFocusListener(new FocusListener() {
                public void focusGained(FocusEvent e) {
                    System.out.println("I TOOK FOCUS! W00t!");
                public void focusLost(FocusEvent e) {
                    //To change body of implemented methods use File | Settings | File Templates.
            JTabbedPane tabbedPane = createTabbedPane(0);
            getContentPane().add(focusStealer, BorderLayout.NORTH);
            getContentPane().add(tabbedPane, BorderLayout.CENTER);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(300, 200);
            setLocation(400, 200);
            setVisible(true);
        private JTabbedPane createTabbedPane(int deep) {
            deep++;
            JTabbedPane tabs = new JTabbedPane();
            for (int i = 0; i < 4; i++) {
                if (deep < 4) {
                    tabs.add(i + ":" + deep + " - Focus", createTabbedPane(deep));
                } else {
                    tabs.add(i + ":" + deep + " - Focus", new JTextField());
            return tabs;
        public static void main(String[] args) {
            new TabPaneTest();
    }

  • Microsoft Excel 2013 Goes Transparent When switching Tabs

    Our site recently moved from Office 2010 to Office 2013 and there haven't been too many issues as of yet.  One of the ones thats being reported is that when you switch from one tab to Excel using Alt+Tab nothing appears.  But when you hold
    the cursor over the page you see that + sign as if your in excel.
    The particular spreadsheet where this happens most frequently has no formulas and almost no formatting apart from a colour code.  Its a list of external links to websites used by their department.  For example New Stories, online resources, thats
    the only out of the ordinary thing that is on this spreadsheet.
    Any ideas for a fix?

    Hi
    To solve the issue more efficiently, I would like to confirm what it exactly means :"hold the cursor over the page you see that + sign as if your in excel". You mean switch between windows diaplayed when clicking Alt+Tab?
    Copy the contents to a new workbook to check if the problem still exists.
    If that doesn't work, repair Office 2013 in Control panel>Program and features>Office 2013(change)>Repair.
    Regards
    Tylor Wang
    TechNet Community Support

  • Error sound on mac when switching tab with cmd+right arrow

    On Firefox 3.6.9 and OSX 10.6.4, when I switch to a tab to the right using cmd+right arrow, I get an error sound but Firefox successfully switches to the tab. The error sound is the same sound you get when you press a keyboard shortcut that doesn't exists (ex: cmd+?)
    However, if I use cmd+left arrow I don't get the error sound.
    How can I eliminate the error sound?

    I am just finally posting a reply. Looks as though the sound card went out. I was told that I could purchase a new open and install myself. I did not do that, but rather my step-dad just decided it was time to buy a new Mac Mini.

  • Numbers on iOS 7 crashes when switching tabs

    About a year ago I created a simple spreadsheet using Numbers on my iPad 2. The first tab has one small sheet on top with a few rows and a second sheet on the bottom. I created a form from the three columns on the second sheet. Every week I make a copy of this spreadsheet for a planning meeting I attend. This morning I tried working with a copy of that spreadsheet. When I switched to the form tab, I had trouble just getting the first field to accept input. Once I get that working, if I switch to the first tab, Numbers crashes.
    The crash happens every time. All I have to do is open the spreadsheet, switch to the form tab, tap in the first field, and switch back to the first tab. As soon as I tap the tab, Numbers crashes immediately. This never happened under any previous version of iOS. I use a Logitech bluetooth keyboard for input, but I got the same crash with the keyboard turned off.

    I had the same issue. Found that the only way to get it to work was input the data in the form and hit the + button as if to add  a a new input then switch to  back to  first  tab  and it will not crash
    Hope it helps ian

Maybe you are looking for

  • Integer value in a variable of assing action is no more integer - OSB

    Hi, I have seen a strange behavior or I wonder am I missing anything in OSB assing action. I am developing a simple proxy service in 11.1.1.6 OSB.Following are the steps involved in my code. In first assign action, the value is assigned as xs:integer

  • Tax Code

    Hai...                In  maintain tax code value at FTXP..the system by default takes the value as 0.00 if i remove the maintained value.Its not possible for me to remove 0.00 value.Can any body help me in maintaining space .....that is without any

  • Vendor's bill-to and ship-to partner

    Hello, I need to identify the Bill-to and Ship-to partner in the account assignment for a vendor.  Can someone please explain how to go about doing this? Thank you, JR

  • Trigger event in alv without button in web dynpro

    Hi Friends, in alv list I can trigger an evant by declaring field i.g. "CONNID" as button. Is it possible without create a button. I mean, when I have several fields like matnr, bukrs etc. I want for each calling the details, but without to declare a

  • Licensed Photoshop Elements,7.0, Windows, Italian: how to reinstall in a new pc?

    I need to reinstall my licence of Photoshop Elements,7.0, Windows, Italian in a new PC. I've tried from my account and I found  the order dated 2009 but the dowload is no more available. I've also tried from the old version section download in the Ad