New Tab overwrites Values in Previous Tab

My basic setup is a main Panel that can hold a number of tabbed panels.
Each tabbed panel has only one scrollpane, which is populated by a table.
The number of tabs is dynamic, and added on the fly.
Adding new tabs works fine, naming is correct.
The issue I encounter is that the results in the table 1, scrollpane 1 get overwritten immediately with the creation of the new tab.
So if i end up with 3 tabs, they all ahve the same data, even though I can watch them populate with the correct data.
I hope that was understandable., heres a piece of the code i believe the culprit.
private void createStatusTab(Object[][] results,int cacheNumber) {
             // some reason second tab overwirtes bvalyues for both...
               // TODO Auto-generated method stub
             //for(int cc=1;cc<=cacheNumber;cc++){
                       // make new tab
                       JPanel cacheResultsPanel = new JPanel();
                       GridBagLayout layout = new GridBagLayout();
                       cacheResultsPanel.setLayout(layout);
                       outputPanel.addTab("", cacheResultsPanel);
                       DateFormat dateFormat = new SimpleDateFormat(
                               "MM/dd/yyyy 'at' hh:mm a z");
                       String dateTime = dateFormat.format(Calendar.getInstance().getTime());
                       outputPanel.addTab("Cache Cleared - Results: "+environment.getName(),cacheResultsPanel);
                       outputPanel.setSelected(cacheResultsPanel);
                       JPanel progressSubPanel = new JPanel();
                       GridBagConstraints c = new GridBagConstraints();
                       c.gridx = 0;
                       c.gridy = 0;
                       //c.weightx= 1.0;
                       //c.weighty= 1.0;
                      /* cacheResultsPanel.add(progressSubPanel, c);
                       progressSubPanel.add(new JLabel("Progress:"));
                       progressSubPanel.add(progressBar);
                       progressBar.setValue(0);
                       progressBar.setStringPainted(true);*/
                      outputPanel.addTab("Cache "+cacheNumber,cacheResultsPanel);
                      outputPanel.setSelected(cacheResultsPanel);
                      // works but uses one panel
                     JScrollPane tempPane= fillTable(results);
                      cacheResultsPanel.add(tempPane);
                      cacheResultsPanel.updateUI();   
                      LOG.debug("Tab: "+cacheNumber+" Added");
             //}// end for each cache
          }the filltable method where the scrollpane is created froma table.
private JScrollPane fillTable(Object[][] finalResults) {
               // TODO Auto-generated method stub
             Object[] columns =cacheDetails.keySet().toArray();
              resultsTable=new JTable(finalResults,cacheDetails.keySet().toArray());
              LOG.debug(cacheDetails.keySet().toString());
              LOG.debug(cacheDetails.values().toArray().length);
             resultsTable.setDragEnabled(true);
             resultsTable.setPreferredScrollableViewportSize(new Dimension(700,400));
             resultsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
             resultsTable.setAutoscrolls(true);
             //set column sizes
             TableColumn column = null;
             int size=cacheDetails.size();
             for (int i = 0; i < size; i++) {
                  //int length=finalResults[0].toString().length()*8;
     int headerLength=columns[i].toString().length()+1;
     int detailLength=finalResults[0][i].toString().length()+1;
     int length=0;
     if(headerLength>detailLength){
          length=(headerLength)*8;
     }else{
          length=(detailLength)*8;
column = resultsTable.getColumnModel().getColumn(i);
column.setPreferredWidth(length);
JScrollPane scrollPane=new JScrollPane(resultsTable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
return scrollPane;
           i end up with all tabs being filled with the same scroll panel. how do i make them independent and dynamic like the tabs.  is the table or the scrollpane the culprit?
Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

I made a new class called TabBuilder. TYhis class is called as a new instance everytime i call it.
Stilll I have issues,
class TabBuilder{
         public void createStatusTab(Object[][] results,int cacheNumber) {
         // some reason second tab overwirtes bvalyues for both...
          // TODO Auto-generated method stub
                  // make new tab
                  JPanel cacheResultsPanel = new JPanel();
                  GridBagLayout layout = new GridBagLayout();
                  cacheResultsPanel.setLayout(layout);
                  outputPanel.addTab("", cacheResultsPanel);
                  DateFormat dateFormat = new SimpleDateFormat(
                          "MM/dd/yyyy 'at' hh:mm a z");
                  String dateTime = dateFormat.format(Calendar.getInstance().getTime());
                  outputPanel.addTab("Cache Cleared - Results: "+environment.getName(),cacheResultsPanel);
                  outputPanel.setSelected(cacheResultsPanel);
                  JPanel progressSubPanel = new JPanel();
                  GridBagConstraints c = new GridBagConstraints();
                  c.gridx = 0;
                  c.gridy = 0;
                  //c.weightx= 1.0;
                  //c.weighty= 1.0;
                 /* cacheResultsPanel.add(progressSubPanel, c);
                  progressSubPanel.add(new JLabel("Progress:"));
                  progressSubPanel.add(progressBar);
                  progressBar.setValue(0);
                  progressBar.setStringPainted(true);*/
                 outputPanel.addTab("Cache "+cacheNumber,cacheResultsPanel);
                 outputPanel.setSelected(cacheResultsPanel);
                 // works but uses one panel
                JScrollPane tempPane= fillTable(results);
                 cacheResultsPanel.add(tempPane);
                 cacheResultsPanel.updateUI();   
                 LOG.debug("Tab: "+cacheNumber+" Added");
         }// end mehtosd
         private JScrollPane fillTable(Object[][] finalResults) {
               // TODO Auto-generated method stub
             Object[] columns =cacheDetails.keySet().toArray();
              resultsTable=new JTable(finalResults,cacheDetails.keySet().toArray());
              LOG.debug(cacheDetails.keySet().toString());
              LOG.debug(cacheDetails.values().toArray().length);
             resultsTable.setDragEnabled(true);
             resultsTable.setPreferredScrollableViewportSize(new Dimension(700,400));
             resultsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
             resultsTable.setAutoscrolls(true);
             //set column sizes
             TableColumn column = null;
             int size=cacheDetails.size();
             for (int i = 0; i < size; i++) {
                  //int length=finalResults[0].toString().length()*8;
     int headerLength=columns[i].toString().length()+1;
     int detailLength=finalResults[0][i].toString().length()+1;
     int length=0;
     if(headerLength>detailLength){
          length=(headerLength)*8;
     }else{
          length=(detailLength)*8;
column = resultsTable.getColumnModel().getColumn(i);
column.setPreferredWidth(length);
JScrollPane scrollPane=new JScrollPane(resultsTable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
return scrollPane;
}// tab builder class
Calling CodeTabBuilder newTab= new TabBuilder();
               newTab.createStatusTab(finalResults, i);Edited by: Masterkeedu on Oct 15, 2007 8:09 AM
Stupid { code } tags..honestly, stupid.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Even though set to open to home page, Firefox always opens in a new tab and to the previous tabs. All settings seem correct. I just want it to open in a new window to my home page

    I cannot open Firefox in a clean new window to the home page. Options are set to open to home page and open new window in new tab is deselected. I do not want my history coming up every time I open. All new pages come up in a new tab with the existing one staying put.

    This happens when I have multiple windows open. I have one window minimized on the task bar. I then launch a new firefox window and start surfing, opening multiple tabs in that window. Then I close that window. (My original window is still minimized in the taskbar). Now, I launch a new firefox window and the tabs that I had opened in the window I had just closed are all back.
    If I close all windows and then launch firefox, it goes to my home page.
    FYI, I'm running Windows 7 64-bit.

  • New tab cancels loading of previous tab

    Is there a workaround to this scenario?
    I have two URLs I'd like to open. I type the first URL in the main window. While it's still loading, I type Command-T for a new tab and type in my second URL. Meanwhile, the first URL stopped loading as soon as I launched the new tab.
    By contrast, in Chrome I could quickly type 10 URLs in separate tabs and they're all loading at the same time.

    Hi,
    with BADI_FDCB_SUBBAS04  you can only display the new subscreen in "Basic data tab".
    I do not know if it is possible to create a new tab in header of MIRO transaction.
    check this:
    http://wiki.sdn.sap.com/wiki/display/Snippets/Displaycustomerfieldsinheaderoflogisticsinvoiceverification+transactions
    Best regards.

  • If you check the don't show this again box when closing multiple tabs, how do you get it to warn you when closing multiple tabs, or to save previous tabs? Checking the warn me when closing multiple tabs box under tools/tabs does not work to solve this?

    I accidentally checked the do not ask me again box when closing multiple tabs. Now I no longer get a warning when closing multiple tabs, and it saves my previous session. I have tried checking and un-checking the warn me box under tools which has not worked. If I open a second window and try to close multiple tabs it will warn me but not on the first window.

    You can reset the warn prefs on the about:config page via the right-click context menu.
    browser.tabs.warnOnClose , see http://kb.mozillazine.org/About%3Aconfig_entries
    browser.warnOnQuit , see http://kb.mozillazine.org/browser.warnOnQuit
    browser.warnOnRestart , see http://kb.mozillazine.org/browser.warnOnRestart
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • Firefox crashes computer shuts down and tabs are lost. restore previous tabs was activated. how to restore tabs from yesterday

    I also tried some of the suggestions in forum. There are no files found that match sessionstore.js file appdata etc. How do I recover tabs? Windows 7 pro and most recent firefox.

    [About:sessionrestore] and please also see: [http://mzl.la/MIUY4q How to restore my session]

  • Always have 2 FF15.0.1 tabs and start w/previous tabs/win. Any time I start FF the second window always looses the 1st tab and places the "+" to the far left.

    When I close FF the window that is active becomes window #1 when I restart. No matter which one becomes window #2 the first pinned tab is missing and the "+" is on the far left. Same occurs if the tabs are not pinned. If I close FF and cause a switch between W#1 and W#2, W#2 loses that 1st tab and in W#1 the missing tab reappears.

    hello ppsffvt, it sounds like an extension might be interfering here. please try launching firefox in safe mode once and see if the issue is occurring there too.
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • How can you set up a custom keyboard shortcut for Next Tab and Previous Tab?

    You can do this in Chrome because there is a top menu item for it, and OS X supports easily rebinding of keyboard shortcuts that are in the main menus.
    Is this possible in Firefox? Using a two handed shortcut to switch tabs is annoying when you want to keep one hand on the mouse!
    Thanks!

    Keyboard shortcuts
    * https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts
    -> Next Tab
    * Ctrl + Tab
    * Ctrl + Page Down
    -> Previous Tab
    * Ctrl + Shift + Tab
    * Ctrl + Page Up
    Check and tell if its working.

  • New website overwrites previous tab--how to open it in a new tab?

    When I open a new website, rather than opening a new tab, it takes the one that's already open. How can I make it open in a new tab?

    You can click on the link or bookmark using Ctrl+click or Ctrl+Shift+click.
    One of them will open in the foreground in a new tab the other in the background into a new tab. Depends on your options settings.
    Some items you might want to set in '''about:config''', see Firefox configuration variables relating to clicking on a link or on a bookmark. (#newtab)<br>http://dmcritchie.mvps.org/firefox/keyboard.htm#newtab
    You might want to try these settings in your about:config as described in the above link.
    :'''browser.search.openintab''' user set '''true'''
    :browser.tabs.loadBookmarksInBackground default false (***)
    :browser.tabs.loadDivertedInBackground default false
    :browser.tabs.loadFolderAndReplace user set false
    :browser.tabs.loadInBackground user set false (***)
    (***) you want these two to have the same setting so opening from a link will be the same as opening from a bookmark or opening from history.
    Google Search results > upper right corner gear/settings:
    Results Window: [x] Open search results in a new browser window.
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • Why will Firefox allow me to have multiple tabs available, but not allow me to switch between tabs, and can only look at a new tab by closing the previous one?

    Whenever I open a new tab, it appears on the tab bar where it should, but if I click on it nothing happens, the tab won't open, and I can't switch between multiple tabs. The only way to get to a new tab is to close the one I am currently on, and even then it will only open the next tab in order of precedence, so I can not even choose which tab is the next to view. This problem is making it impossible to use firefox as a research tool which requires fast switching back and forth between multiple tabbed pages simultaneously.

    '''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.

  • Add new tab button does not appear at the right of the previous tab

    Just upgraded to Firefox 4 and the plus sign (T) for a new tab does not appear on the right of the previous tab as it had in earlier versions. I thought it was there briefly after I upgraded but it's not there anymore. How do I get it back? I did download the extension "new tab at the end" but that didn't help....

    That button should be available by default. However, if you use tab related Add-ons it may not show up as expected. You can add it back by right clicking on the navigation bar, clicking Customize, then drag the New Tab icon to the right end of tab bar.
    If that doesn't work, please try starting Firefox in Safemode to see if add-ons are indeed interfering.

  • How do you have Google searches appear in new tab? This was previously not a problem, but it changed and I cannot return the setting. Any ideas?

    How do you have Google searches appear in new tab? This was previously not a problem, but it changed and I cannot return the setting. Any ideas?

    I recently purchased a second hand new macbook air, although it was second hand to me the previous owner had never actually turned it on.
    Something doesn't make sense here, though I'm not saying the previous owner is lying....
    Time to send your serial # to iTS and let them see what's happening here.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • When entering a new website it overrides the previous site, how can i get it to open a new tab instead

    I DON'T KNOW THAT THIS IS A PROBLEM, I JUST THOUGHT THAT IF THERE IS A WAY TO OPEN A NEW TAB EACH TIME YOU ENTER A NEW WEBSITE WITHOUT OVERRIDING THE PREVIOUS ONE. YOU WOULDN'T HAVE TO REMEMBER TO ENTER THE PLUS SIGN EACH TIME YOU WANT TO OPEN A NEW WEBSITE.

    The setting in Tools > Options > Tabs: "New pages should be opened in": "a new tab/window" is for links that specify a target window to open the link.
    That option allows to divert such links to a new tab instead of a new window.
    For links that do not specify a target use a middle-click or hold down Ctrl and left-click the link or use the right-click context menu to open the link in a new tab or window.<br />
    Left-click a JavaScript link to avoid getting a blank tab.

  • Safari opens new page in previous tab

    Hello!
    I am a new macbook user (i got one just 2 months ago :)), but I was using safari for about 2 years now.
    It all started with opening the links in new tab. I didn't know, that one could use command button to open a new tab, so i always went through "right click -> open in new tab"
    then one day i didn't get that option anymore (just "open in new window") so i started to use command button to open a link in a new tab
    but now the problem is the following: let's suppose i have 3 tabs open, and i want to open a new clean tab (tab 4) (its gonna be a direct transfer to the "top site" page). no prob here, i open it, but whenever i want to open in this new clean tab (tab 4) a new page (eg, google) it will automatically open in the previous tab (tab 3), tab 4 stays clean!!
    how can i manage this problem?
    i already tried to reinstall the latest version of safari, but it didnt help.
    the problem is, its not always that i have this error, but it really drives me crazy when i do have it.
    I am open to your every suggestion, thank you very much for your help!
    Aesone

    Hi and welcome....
    First, go to your Safari menu bar, click Safari / Empty Cache. Restart Safari. If that didn't make a difference, reset Safari from the menu bar, select the top 7 buttons, click Reset.
    If that didn't help either, try troubleshooting the Safari .plist file. Quit Safari (Command + Q)
    Open a Finder window. Select your Home Folder in the Sidebar on the left. It has a small house icon. Then open the Library folder then the Preferences folder.
    Move the com.apple.Safari.plist file from the Preferences folder to the Desktop. Now launch Safari. If Tabs work, move that .plist file to the Trash. If not, move the .plist file back to the Preferences folder.
    Carolyn

  • When I start firefox, the previous tabs are there but blank and say new tab, can I restore the tabs?

    When I start firefox, the previous tabs are there but blank and say new tab, can I restore the tabs?
    how can I do this?

    I'm not sure what causes this.
    As the first step, I recommend backing up your existing sessionstore files.
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > "Show Folder" button
    Scroll down to the files whose names start with sessionstore. You should find at least sessionstore.js and sessionstore.bak. If the .js extension does not appear on sessionstore, you should turn off the Windows feature that hides file extensions from you, so that you can work with file names as accurately as possible. This Microsoft support article has the steps: [http://support.microsoft.com/kb/865219].
    Make backup copies of all the sessionstore files to somewhere like your Documents folder for possible later restoration.
    Next, try one of the data mining techniques in these posts to rescue the URLs from the sessionstore.js or sessionstore.bak file:
    * Using Firefox's Browser Console (formerly known as Error Console): https://support.mozilla.org/questions/969046#answer-471950
    * Using Firefox developer tool "Scratchpad": http://forums.mozillazine.org/viewtopic.php?f=38&t=622036&start=60&p=12098147#p12098147
    * Using a third party website: https://firefox-session-restore.herokuapp.com/

  • Firefow auto updated "5 beta", lost all previous tabs, "unresponsive script" opens w/each new window...Can you help?

    firefox auto updated to "5.0", then when opening firefox, got "unresponsive script"(which had to be closed to start firefox, and then the same opening w/each new window...(In doing this I then lost all previous tabs).
    Can you help?

    ''FredMcD [[#answer-691408|said]]''
    <blockquote>
    That is a known issue.
    '''[http://www.mozilla.org/en-US/firefox/all/ Download Firefox Full Installer For All languages And Systems]''' {web link}
    </blockquote>
    Fred,
    Thanks so much for the reply. Amy way you could elaborate on the "known issue" aspect? Is there another thread I missed? Some sort of Knowledge base article? also, I'm not sure why you linked to the page you did. FF is installed on all my machines and I can of course download the latest version every couple of weeks and push it to all my lab iMacs using ARD, so I'm confused as to why you linnked me to FF's installer page - is there something I can do with the installer that will alow auto-updates that I'm missing/not aware of?
    Again, thanks for the heads-up and any further elaboration on either further info on the issue or how I might use the installer to auto-update all my machines will be appreciated.

Maybe you are looking for

  • General Ledger Report Criteria Selection

    Hi, just a general question in regards to running the general ledger report.  I would have thought the expanded button would be user specific, as it is not it means that each user has to check and change the selection for each report incase someone e

  • MBA - slow internet/wifi then photo stream is enabled

    I have problem with very slow internet /wifi connection when photo stream is enabled. I run some test. I'm conecting MBA to internet by WIFI network. When photo stream is enabled, ping reply time to my router is around 1000ms - 2000ms. When I turn of

  • Network install from solaris 10 x86 server to x86 client

    My setup is: install server OS: Solaris 10, i86pc . The install server is also boot server using tftpboot. The dhpc server is configured according to the instructions which are given when adding an install client in Solaris 10. The client can communi

  • Workforce planning query

    Dear Experts,          While trying to do workforce planning (Workforce planning:Project View), I get the following message: "No requirements were found for the selection criteria". Kindly let me know what may be the possible reasons for getting this

  • When i browse OS X Server (Mountain Lion) Wiki through webdav i can't open any files and they all are 4kb in size?!

    When i browse OS X Server (Mountain Lion) Wiki through webdav i can't open any files and they all are 4kb in size?! Why is this ... is my configuration wrong in some way? I just put a tick mark in the