JTabbedPane slow first new tab

I have noticed something strange with my Swing user interface. I'm going to describe the symptoms and hopefully someone can help me narrow the problem to a bit of code that I can post. Currently, I have no idea about which part of my code may be causing the problem.
I have a JTabbedPane with one tab that contains a JTable. This part of the GUI is displayed at start up. If a user opens a text file, the text is added to a JTextArea and then displayed in a new tab. The first time that I open a text file there is a noticeable delay before it is displayed. Every subsequent file that is opened is displayed very quickly in a new tab. Why would there be such a delay with the first new tab that is added but not the other?
Thanks
Message was edited by:
Jstats

Sounds like initialization is your enemy. You should use a profiler to check.

Similar Messages

  • IE11 trying to resolve proxy for DUMMY 00 host on first new tab

    Internet Explorer Version 11.0.9600.17420
    IE 11.0.14 (KB3003057)
    Windows 7 SP1 32bit
    While testing IE 11 in offices with slow connections our test users reported strange application hangs when opening the first new tab. The initial load of the home page and all subsequent tabs after the first new one are working just fine.
    The hangs will persist for nearly 2 minutes and then IE will load the desired page just fine without any user interaction. It's as if the application hangs somewhere in a loop.
    While trying to solve the issue we were able to pinpoint it to our proxy.pac in which we're using the "IsInNet" function to determine if a certain host is in a specific subnet. After a few Wireshark traces we found that when opening the first new
    tab (and only then) IE 11 will try to resolve the proxy for a host named "DUMMY<00>". Of course we don't have any DNS records for that name so IE seems to fall back to using NBNS. We only have one central NBNS server, so this
    will cause the delay our remote users noticed (it takes them about five seconds for one request to be handled).
    As a workaround we've adjusted our proxy.pac to save the resolved IP of the host to a variable, therefore reducing our name resolution queries from previously 35 to a single one. This doesn't get rid of the hang completely but it helps a lot in that
    the delay is now more like five seconds than two minutes.
    I'm now trying to figure out why IE is querying "DUMMY<00>" in the first place but so far I'm out of ideas. Does anyone have some insight as to why that's happening? Is it a certain setting we need to adjust or is this by design? We've never
    noticed anything similar with IE 9.

    Hi,
    Untill now, based on my research, the only way to bypass this error is just workaround method, there is no fixed method to resolve the problem. You can try to use these two method as workaround method:
    1. Add to the proxy pac file:
                    function FindProxyForURL(url, host)
                    // Workaround for IE11
                    if (shExpMatch(url, "http://dummy/"))
                       return "DIRECT";
    2. Add the “dummy” in the DNS or hosts files.
    Roger Lu
    TechNet Community Support

  • Safari slow opening new tabs

    Hi,
    After a fresh install of yosemite I noticed that safari is really slow (about a 3-5 seconds lag) opening new tabs, not everytime but most of the time (around 50%). This behavior also occurs when I focus the url bar.
    It happens using the mouse and also using the keyboard shorcuts (⌘+T and ⌘+L respectively).
    First thing I tried was disabling Safari Sharing on the iCloud settings but it didn't work. I also tried all of the usual suspects: deleting caches, cookies, reset safari, etc... As I said it happened from the first minute after a clean install of yosemite.
    Any help would be appreciated. Thank you.

    I have the exact same problem and it kills usability. I filed a bug with Apple on bugreport.apple.com (problem ID 1882855). Hopefully we'll hear from them.

  • Add button to JTabbedPane to add new tab

    Does anyone know how to add a JButton to a JTabbed pane (in the tab bar) so that it is always at the end of all the tabs and when it is clicked it will add a new tab into the tabbed pane.
    The functionallity I am looking for is the same as that provided by the button in the tab bar for Firefox and Internet Explorer.

    Along the line of what TBM was saying:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class NewTabDemo implements Runnable
      JTabbedPane tabs;
      ChangeListener listener;
      int numTabs;
      public static void main(String[] args)
        SwingUtilities.invokeLater(new NewTabDemo());
      public void run()
        listener = new ChangeListener()
          public void stateChanged(ChangeEvent e)
            addNewTab();
        tabs = new JTabbedPane();
        tabs.add(new JPanel(), "Tab " + String.valueOf(numTabs), numTabs++);
        tabs.add(new JPanel(), "+", numTabs++);
        tabs.addChangeListener(listener);
        JFrame frame = new JFrame(this.getClass().getName());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(tabs, BorderLayout.CENTER);
        frame.pack();
        frame.setSize(new Dimension(400,200));
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      private void addNewTab()
        int index = numTabs-1;
        if (tabs.getSelectedIndex() == index)
          tabs.add(new JPanel(), "Tab " + String.valueOf(index), index);
          tabs.removeChangeListener(listener);
          tabs.setSelectedIndex(index);
          tabs.addChangeListener(listener);
          numTabs++;
    }

  • Jp2ssv.dll slows down new tabs with IE7/Vista

    java version "1.6.0_11"
    Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
    Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
    IE7/Vista Home Basic (SP1, ITA, x86) all fully updated.
    If the ActiveX plugin for IE7 named 'Java (tm) Plug-In 2 SSV Helper' (jp2ssv.dll) is enabled, IE7 takes 3-4 seconds to open every new tab. A very boring delay.
    If I disable that ActiveX control only, everything works fine at the expected speed, both Java web-based pages and IE7.
    What's this ActiveX for? And why it causes long 3-4 secs delay when enabled?

    kelbers wrote:
    Do you have a bug tracking number ?No, I just received an email with:
    Dear Java Developer,
    Thank you for your interest in improving the quality of Java Technology.
    Your report has been assigned an internal review ID of 1409949, which is NOT visible on the Sun Developer Network (SDN).
    Please be aware that the large volume of reports we receive sometimes prevents us from responding individually to each message.
    If the information is determined to be a new Bug or RFE, or a duplicate of a known Bug or RFE, you will receive a followup email containing a seven digit bug number.  You may search for, view, or vote for this bug in the Bug Database at http://bugs.sun.com/.
    ...waiting for the followup I've never seen :(

  • New tabs, automatic selection not consistent

    Running Safari 4.0.1 on a 20" 2.16gHz iMac with OS X 10.5.7 with 4GB RAM.
    Has anyone noticed this? My home page is Google (I don't like the Search box). When I Command-T to open a new tab, the auto selection is not consistent. If it is the first new tab that I open, the address bar is selected. For all subsequent tabs, the Google search box is selected. I would, of course, prefer that the Google search box is selected for all tabs. Why would Apple make this different depending on whether I'm opening tab #2 or tab #7? It should be consistent, first of all. In a perfect world, it would always select the Google search box first. Mouse-free browsing is the way to go.

    You can find the New Tab button showing as a '+' on the Tab bar.<br />
    You can open the Customize window and drag the New Tab button from the Tab bar on another toolbar and it will become a regular toolbar button like the New Tab button that you have in Firefox 3 versions.<br />
    If you want the New Tab button at the far right end of the Tab bar then place a flexible to the left of it.
    * New tab toolbar button: https://addons.mozilla.org/firefox/addon/new-tab-toolbar-button/
    If you click the new window toolbar icon or use Firefox > Tab > Open New Window then you always open a new window.

  • How can I get New Window back to the top as first choice? v4.0 has swapped it with New Tab.I'm using v4.0 on a Mac.

    I'm used to clicking on File and having New Window as my first choice. New Tab is now at the top of the list. My brain is slow to make the transition to the new format and I keep choosing New Tab in error. Can I swap them?

    Hi hopefromct,
    As someone who uses predictive typing constantly when I use my iPhone I can understand not having it available would be upsetting. Let's see if we can get you back up and running.
    You can activate predictive typing by going to Settings > Keyboard > Predictive and turn it on. See this help article for reference - 
    Enter text - iPhone
    If you have just hidden the predictive text suggestions by moving the suggestions bar down you will see just the gray top of that bar. You can drag it up again to regain the view.
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • JTabbedPane new tab problem

    I have a question regarding the TabbedPane, and forgive my ignorance as I've only just started. I am attempting to create a telnet/SSL application that allows you to open and close new tabs while the window's running, much like any tabbed web browser. I see there's a getTabCount() method, but it doesn't seem to work as I expected, or I'm using it incorrectly. Basically, each tab is supposed to have its own jTextArea to allow the user to connect to a remote host using a non-secure or secure method. The method that performs the action is below. If I put the "tabcount" int in the setTabComponentAt(), an index out of bounds error is returned in the stack trace and it appears to default to 0; if I put 0 in there as it is below, the stack trace goes away and the TabbedCommunicator class creates the tab with the close button. It just never seems to want to have more than one tab at a time. Any input is welcome and appreciated
    private void performNewTab(java.awt.event.ActionEvent evt) {                              
            int tabcount = jTabbedPane1.getTabCount();
            tabcount++;
            String title = "untitled_" + tabcount;
            jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
            jTabbedPane1.addTab(title, jScrollPane3);
            jTabbedPane1.setTabComponentAt(0,new TabbedCommunicator(jTabbedPane1));
            jTabbedPane1.getAccessibleContext().setAccessibleName("");
            return;
        }

    Before posting, I was aware of how the tab components are accessed. For whatever reason, I left out the "tabcount--;" that was there after the title for the tab. If I adjusted the code to not hard-code to 0, I still received the same stack trace error (ArrayIndexOutOfBounds) as I did before the tabcount--; was added. It's as if the tabbed pane itself can only hold one tab, and in order to have multiple tabs, you've got to have multiple tabbed panes. The setTabComponentAT() method is being used to create the closeable tab. That portion of the code works great when the application is first started, as well as when the tab is closed, then the File->New Tab menu is accessed. But if the closeable tab is still there and File->New Tab is accessed, it persists at creating only one tab, and that tab's closeable feature doesn't work..
    The stack trace is:
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
    at java.util.Vector.elementAt(Vector.java:427)
    at javax.swing.JTabbedPane.getTabComponentAt(JTabbedPane.java:2363)
    at javax.swing.JTabbedPane.setTabComponentAt(JTabbedPane.java:2340)
    at clientgui.JavaCommunicationsGUI.performNewTab(JavaCommunicationsGUI.java:398)
    at clientgui.JavaCommunicationsGUI.access$100(JavaCommunicationsGUI.java:41)
    at clientgui.JavaCommunicationsGUI$2.actionPerformed(JavaCommunicationsGUI.java:296)

  • I would like to be able to start typing a URL directly (with no need to clear the field first) after opening a new tab with my homepage...

    I've just installed the newest desktop version of the Firefox browser because my Opera doesn't feel very well these days. I'm trying to become friends with Firefox, and that's why I've changed the new tab settings in order to have my offline homepage loaded every time I open a new tab. There is an inconvenience — when I press Ctrl+T, the cursor appears at the end of the URL. It means that when I start typing, the letters show in the address bar after the URL of my homepage, so what I need is to clear the field first.
    Is there a way to get rid of this? (If it helpes, I'm currently using Windows 7.)
    I would appreciate if I could just press Ctrl+T, type a URL, and press Enter when I want to go to a website different from my homepage. Thank you for your replies!

    Then you can use (Ctrl+L and) Ctrl+A to select all the text in the location bar or Shift+Home/End.

  • How do i add a site to New Tab page without making it a bookmark first?

    ''locking a a duplicate of https://support.mozilla.org/en-US/questions/1039823''
    presently, to add to my New Tab page:
    0 = bookmark the page
    1 = then drag fhe star to an empty rectangle on the New Tab page
    i want just to drag or type it in without having to first bookmark it. please advise.

    You can drag an history item as well (e.g. from the history sidebar), so yuo do not need to bookmark a website.

  • When I open a new firefox window, and click the + to open a new tab, my first page disappears - I can only seem to return to it by closing all the other tabs.

    The issue occurs like this:
    1. Open a new window
    2. Enter a URL and go to a page (any page).
    3. Click the + and open a new tab.
    4. The first tab is no longer visible in the tabs bar.
    5. I keep opening lots of other tabs and the first tab stays invisible (all the others stay visible / accessible).
    6. The only way I've found to return to the first tab is to close all my other tabs.
    This doesn't always happen (i.e. I can have two firefox windows open and only one of them does it!)
    I'm not sure if it's a feature or something? But it's very annoying!
    Any ideas welcomed.
    Thanks

    Hi - yes I can! I hadn't noticed that little arrow before, thanks.
    However I would really like to stop it hiding the first tab all the time.... Even when I navigate to the first tab using that "list all tabs" arrow, it still remains 'hidden' (i.e. I can't see a tab up the top, even when that tab is active. And when I navigate away from it to another tab, it is invisible again).
    Any ideas?
    Thanks

  • Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main website, like google.

    Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main window, like google.
    This does not happen when opening in a new window (shift+click).
    It was never a problem in older versions. I now have ff 3.6.17. I' afraid to install ff4 because everytime i do so (install e new version) something i liked dissapears or good add ons dont work anymore!
    I also don't like the fact that more and more of the adress barr is beïng used for crap i don't need. I'm a visual handicap and need all the space i can, just to read.
    Thanks for helping me out.

    To help other users find solutions, please return to this Thread and '''Sign-in''' to the forum with your Username and Password:
    click on '''"Solved It"''' next to the reply ABOVE that '''BEST''' solved your question
    '''DO NOT click "Solved It" next to this reply

  • Adding a new Tab to an existing JTabbedPane not working

    Hello all,
    I am trying to add & display a new tab to an existing JTabbedPane when the user
    clicks on a button. For some reason the new tab, being added is not being displayed, and I don't know why. I have called invalidate(), validate() on the parent containers but haven't had any luck. I have also played around with SwingUtilities.invokeLater() and the Event thread, but have been unsuccessfull.
    Any help would be greatly appreciated.
          * This class is the parent that holds the internalFrame which is the
          * main parent for all subsequent containers
         public class QuoteRequestGUI implements QuoteRequestGUI_IF {
              protected JInternalFrame internalFrame_newQuoteRequest = new JInternalFrame("Quote Request");
              protected JTabbedPane tabbedPane = new JTabbedPane();
               * Create a new internal frame to which all the components of a new
               * QR will be added
              public JInternalFrame createNewQuoteRequestFrame() {
                   // Add a tabbed pane to the internal frame
                   internalFrame_newQuoteRequest.add(createQuoteRequestTabbedPane());
                   // .... Set various internalFrame properties
                   return internalFrame_newQuoteRequest;
              public JTabbedPane createQuoteRequestTabbedPane() {
                   // Create a new quote request details instance
                   QuoteRequestDetailsGUI_IF quoteRequestDetailsGUI =
                        new QuoteRequestDetailsGUI(quoteRequestStatusPassed);
                   // Create a new tab that will host all details of the quote request     
                   tabbedPane.addTab("Quote Request Details",
                             quoteRequestDetailsGUI.createQuoteRequestDetailsPanel());
                   return tabbedPane;
         public class QuoteRequestDetailsGUI extends QuoteRequestGUI implements QuoteRequestDetailsGUI_IF {
              private ProductDetailsGUI_IF productDetailsGUI = new ProductDetailsGUI();
               * Panel that will act as a container for both quote request and buyer
               * details
              public JPanel createQuoteRequestDetailsPanel() {
                   // Panel that will contain quoteRequest, buyer and buttons
                   JPanel panel_quoteRequestDetails = new JPanel();
                   // Create an intermediate panel so that components can be layed out properly
                   JPanel panel_quoteRequestIntermediatePanel = new JPanel();
                   // Set layout manager for panel
                   panel_quoteRequestIntermediatePanel.setLayout(
                        new BoxLayout(panel_quoteRequestIntermediatePanel,BoxLayout.PAGE_AXIS));
                   // Add the buttons
                   panel_quoteRequestIntermediatePanel.add(createQuoteRequestDetailsButtons());
                   // Add the intermediate panel to the main panel
                   panel_quoteRequestDetails.add(panel_quoteRequestIntermediatePanel);
                   return panel_quoteRequestDetails;
               * Panel that will hold all the buttons for the quote request details tabbed panel
              public JPanel createQuoteRequestDetailsButtons() {
                   // Panel to act as a container for the buttons
                   JPanel panel_quoteRequestDetailsButtons = new JPanel();
                   // Create, register action listeners and add buttons to the panel
                   JButton button_saveTabbedPane = new JButton("Save");
                   button_saveTabbedPane.addActionListener(new ActionListener() {
                        public void actionPerformed (ActionEvent actionEvent) {
                               saveTabbedPaneListener();
                   panel_quoteRequestDetailsButtons.add(button_saveTabbedPane);
                   return panel_quoteRequestDetailsButtons;
               * Display the save (product details) tabbed pane
               * @todo - Implement the save tabbed pane selected method
              public void saveTabbedPaneListener() {
                        log.info("tab count before added : " + tabbedPane.getTabCount());
                        // The product details of a particular quote request
                        tabbedPane.addTab("Product Details",
                                  productDetailsGUI.createProductDetailsPanel());
                        log.info("tab count after added : " + tabbedPane.getTabCount());
                        tabbedPane.invalidate();
                        tabbedPane.validate();
                        internalFrame_newQuoteRequest.revalidate();
         public class ProductDetailsGUI implements ProductDetailsGUI_IF {
               * Panel that will act as a container for both the product details (incl
               * table) and the buttons
              public JPanel createProductDetailsPanel() {
                   // Main product details panel
                   JPanel panel_productDetails = new JPanel();
                   // Add the scroll pane to the panel
                   panel_productDetails.add(new JButton("ok"));
                   // Add the buttons to the panel
                   // Add the scroll pane to the panel
                   panel_productDetails.add(new JButton("cancel"));
                   return panel_productDetails;
         }

    MS,
    Try copying one existing TAB and use that, this happens only when there is improper xml content. You can open the xml in the browser/visual studio for better clarity and then try making the changes. Doing IIS Reset will be required but in the meanwhile you
    can put the original RCDC which will work till the time you make any change in new TAB.
    Regards,
    Manuj Khurana

  • When I right click and select open link in new tab, it leaves the page I am on and takes me to the first tab to the right

    I usually have many tabs open when I read the news, and it is nice to select open links in new tabs while scrolling through a news' home page. Lately, however, Mozilla has been opening the new tab, but switches the page I am viewing to the first tab to the right of the home page. For example, I had ESPN.com open, and then a few Facebook tabs after that to the right. Whenever I would select open link in new tab, the tab I was viewing would switch from ESPN.com to the first Facebook tab to the right, and the new tab would open a little further down the line. Any chance anyone knows how to fix this?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • "Open Link in New Tab" doesn't remember first page in history

    I recently noticed that the "Open Link in New Tab" is not remembering the very first page in the tab history. The replication is simple.
    # Go to any page (Google works well)
    # Right click and chose to open a link on the page in a new tab
    # On the new tab, left click a link to load a new page
    # The "Go back one page" button will remain grey and you will not be able to go back to the first page for the tab.
    # Left click another link and the "Go back one page" button will now be active allowing you to go to the previous page, but not all the way back to the first page of the tab.
    This happens whether I use the middle mouse or a right click and chose open in new tab. It is present since I upgraded to Firefox 4.0, but was also happening before the upgrade when I was using Firefox 3.6.

    I have the same problem. There are two other problems that might be related. The first one is, sometimes it seems like Firefox loses focus of the page so if I try to refresh the page using CTRL-R or the refresh button, nothing happens. The only way to refresh the page is to hit CTRL-L and Enter as it you're opening the page again. The second problem happens when another window is opened (e.g. new window, new bookmark window from CTRL-SHIFT-B). When you go back to the original window, everytime you go to the tab that the new window was opened from, somehow Firefox brings the window to the front, but the focus is still on the tab.

Maybe you are looking for