JTabbedPane - removing/adding tabs

Using JDK 1.4, I am attempting to refresh a JTabbedPane based on a user selection. I have tried several approaches (removing all of the tabs from the JTabbedPane; removing the panel the JTabbedPane sits on from a larger panel). In both cases, doing a remove (JTabbedPane.removeAll for the JTabbedPane, and Panel.remove [component] for the panel), the area where the JTabbedPane should appear is blank. Here is the code I have tried (createTabs calls the addTab method; createTabPanel puts the tabbedpane on a panel):
public void refreshWindow ( String asReportNo )
     // Remove current tab panel from main panel
     csjpMainPanel.remove ( csjpTabPanel );
     // Recreate tabs, then tab panel
     //csjtab.removeAll();
     //csjtab.revalidate();
     JTabbedPane lsjtab = createTabs ( asReportNo );
     csjtab = lsjtab;
     csjpTabPanel = createTabPanel();
     //csjtab.setVisible ( true );
     //csjpTabPanel.setVisible ( true );
     csjpTabPanel.revalidate();          
     csjpTabPanel.repaint();
     // Put tab panel back on main panel
     GridBagConstraints lgbc = new GridBagConstraints();
     lgbc.gridx = 1;
     lgbc.gridy = 0;
     lgbc.insets = new Insets ( 3, 3, 3, 3 );
     lgbc.weightx = 1.0;
     lgbc.weighty = 0.5;
     lgbc.fill = GridBagConstraints.BOTH;
     lgbc.anchor = GridBagConstraints.NORTHWEST;
     csjpMainPanel.add ( csjpTabPanel, lgbc );
     csjpMainPanel.repaint();          
Any ideas on what I could do to make the tabbed pane visible? I saw that there was a problem with JTabbedPane in earlier releases, but this is with 1.4.
Thanks,
Van Williams

yes, that's right... remove the synchronized blocks and replace them with invoke laters... If your are going to synchronize this, it has to be
synchronized(monitor) {
// update code
-->
synchronized(tabbedPane.getTreeLock()) {
// update code
which is still not as good as the following
-->
SwingUtilities.invokeLater(new Runnable() {
public void run() {
  // update code
};

Similar Messages

  • JTabbedPane - not selecting newly added tabs

    Is there a way to make it so that newly added tabs in a JTabbedPane are not automatically selected as they are added?
    Thanks,
    Adam

    I don't understand what you mean! It's just the normal behavior addTab and insertTab have! So what do you mean? insertTab remembers the currently selected tab and after adding the new tab tries selecting that one again. Maybe you select the new component after adding it.
    --Rasta                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Removal and adding tabs in user interface

    Hi,can anybody provide me solution for customizing the user interface page menu tabs in SUN Identity Manager.
    My requirement is,i need to remove and add main menu and sub menus in the user interface page in SUN Identity Manager.
    Thanks in advance.
    Edited by: SUNIDMDEV on Feb 21, 2008 10:52 PM

    Hello,
    Article Master and Material Master are one and the same in context (materials are referred as Articles in SAP IS Retail). Please refer the below link for creating the custom fields/adding tab pages
    adding custom tab in material master transaction
    Hope this helps
    Regards
    Shiva

  • Jtabbedpane with replacing tab content

    Hello,
    I am developing an applet that should contain a JTabbedPane with 2 tabs.
    The second tab is easy to do because ti contains one Jpanel all the way.
    the first however is an issue, because i am supposed to change its content when the applet is running.
    this means i have 3 JPanels, J1, J2, J3.
    At tge beginning the applet contains J1 in the first tab.
    and J1 contains a button. when i click that button the applet should replace J1 with J2.
    the problem is i haven't managed to find a solution yet :(
    I have tried with setvisible(false) and validate(). It won't work. I also tried to add the J2 panel over J1, but encountered no succes.
    anybody has any idea ?
    Message was edited by:
    asrfel

    If you want to change back and forth repeatedly then wrap J1/2/3 in a JPanel with a CardLayout.
    If you can discard one when it's done with, use the remove() and insertTab() methods of JTabbedPane.

  • Adding tab to typedef tabcontrol causes class conflict with global variable

    Hi,
    I am quite new to labview. I have to update an existing program and I have a problem whith a tabcontrol. In attachement, I give you a very simple solution showing my problem.
    I have defined a simple tabControl in a typedef ctl. I had it to a VI and in block diagram of this VI, I want to fill a global variable with this control and this global variable is set as "Include Data Type".
    When creating my ctl file with a simple tabcontrol, there is no problem but my tabcontrol only contains 2 tabs. When I use "Add page after" in my ctl file to create a third one, after saving, I get a class conflict error on wire to global variable in my block diagram.
    If I remove added page, all is OK again. I don't understand why adding a new page causes a class conflict. In my attachement, it is very simple but in program that I have to modify, I already have 15 tabs and I just want to add a 16th one so, I am sure there is a mean, but impossible to fond it after many hours...
    If someone can tell me how to make my example works with "Include Data Type" (if I remove it, it always works but that is not what I want) and adding an additional tab, it would hemp me a lot!
    Thanks in advance.
    Yohann
    Attachments:
    test2.zip ‏11 KB

    The problem is that the tab is an enum, and you can't wire two strictly typed references of two different enums together, because they are considered different data types. What you can do is right click the reference control in the global variable and select Show Control, which will show the data type of the reference. You can then replace the control inside the reference with the typedef, which will cause it to update correctly.
    Although that will solve the problem, if you have the reference to a tab control in a global variable, you probably have some issues with your code, but that's not something which can be commented on without more details.
    Try to take over the world!

  • How to remove Competetors TAB  from PCUI Opportunity create trx

    Hi Group,
    we are using CRM 5.0, i want to remove Competitor's TAB from PCUI Opportunity Transaction. i see a option in CRMC_BLUEPRINT_C transaction-> Application/Layout->Define layout of the people-centric UI(Customizing tool). here i went to CRMD_BUS2000111-> Version 1-> Static model-> Tabpage groups-> OPP_1: when i clicked on this i got all Tab's details. but when i tried making OPP_HD_COMP "Inactive" and hit Save that Check mark goes away. tried many times but did not help.
    then i tried going to CRMC_BLUEPRINT_C transaction->Application element-> tab page group structure->OPP_1: here i dont see any entries. do i have to add all Opportunity Tab's  details here or only the Competetor tab details?
    Please let me know does anybody see all Tab's data here or you just enter all Tabs data manually in CRM 5.0? also how can i remove Competetors Tab? your help is appreciated and awarded.
    regards,
    Anu.

    Hello Anu,
    WHen you are in CRMC_BLUEPRINT_C transaction->Application element-> tab page group structure->OPP_1, go to edit mode and import the standard entries from CRMC_BLUEPRINT (on of the buttons on the screen).
    Then, for the tab you don't want to see, just put it as inactive (if not possible, just delete the line, you can always come back to the standard by importing the S tables again).
    Regards,
    Frédéric

  • Need to Remove the tabs group Title from browser window title

    When I use a saved tab group, which means I named that tab group in FF 5,''' the name of the tab group appears at the top of the browser along with the title of the web page I am viewing'''. Not good, I need to remove that tab group title from the browser window title, so I am only seeing the title of the webpage, and nothing from the tab group. How do I do that?
    thanks
    JSC

    You can add the site to the Pop-up Blocker Exceptions list in Options > Content > Block Pop-up Windows > Exceptions
    *See --> [https://support.mozilla.com/en-US/kb/Pop-up%20blocker#w_pop-up-blocker-settings Pop-up blocker-Pop-up blocker settings]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Adding tabs dynamically at runtime for a tab navigator control

    Hi,
    Is it possible in flex builder 2 to dynamically add the tabs
    at runtime to the tab navigator control, if we can add plz tell the
    procedure to do that
    thanks in advance

    Given that you had a tab navigator declared in mxml like
    this:
    <mx:TabNavigator id="myTabber" selectedIndex="0">
    </mx:TabNavigator>
    you should just be able to call the addChild method, passing
    the child tab containers. So for example, in some ActionScript
    event handler:
    var newTab:Canvas = new Canvas();
    myTabber.addChild(newTab);
    bear in mind I haven't done this by adding tabs, but have
    done tons with adding controls to an application at runtime using
    this method (DataGrids, Grid, GridItems, etc...)
    Jason

  • WHY IS THE JUST ADDED TAB STILL NOT ON iTUNES!!???

         Okay so alot of people including myself are wondering why the just added tab in itunes keeps disappearing. I don't understand it because that is where I find most of my music that are new and coming in for that week. I don't understand why they simply just can't put it back on there and let people use it! It's bad enough that we have to pay 1.29 per song when I remember it being that I could have gotten 15 songs worth 15 dollars at .99 cents per song. Nowadays I can get like 11 or 12!!!! YOU GUYS NEED TO SERIOUSLY FIX IT!!!!!!!!!!!!!

    yes it is working for the majority there are a small number of customers who are having problems
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Adding Tab page in to  Item Master Data

    Dear,
    In this momento I can do application external through SDK to SBO. but How can I do adding Tab Tag Page in to Item Master Data,
    Can you explain me How I do?
    Very thanks.
    Regards

    Hi!
    You need add one tabPage in Item Form rigth?
    You can used the function:
    public void AddTab(string formID, string tabName, string tabNum, string tabCaption)
                try
                    Form oForm = oApp.Forms.GetForm(formID, 0);
                        Item oItPosition = oForm.Items.Item(tabNum);
                        Item oItTbTest = oForm.Items.Add(tabName, BoFormItemTypes.it_FOLDER);
                        oItTbTest.Top = oItPosition.Top;
                        oItTbTest.Height = oItPosition.Height;
                        oItTbTest.Width = oItPosition.Width;
                        oItTbTest.Left = (oItPosition.Left + oItPosition.Width) + 20;
                        oItTbTest.AffectsFormMode = true;
                        Folder oTbTest = (Folder)oItTbTest.Specific;
                        oTbTest.Caption = tabCaption;
                        oTbTest.ValOff = "0";
                        oTbTest.ValOn = "1";
                        oTbTest.GroupWith(tabNum);
                catch (Exception e)
                    oApp.StatusBar.SetText(e.Message, BoMessageTime.bmt_Medium, BoStatusBarMessageType.smt_Error);

  • Removal of TABS from File Upload

    Hi all,
    I made an upload of a local file with TAB spaces in an internal table .I am required to remove the TABs from the records.I tried to used command REPLACE '/h' by single space, where '/h' being the TAB , but it did not work.
    How can I achieve the requirement?
    Your ideas are appreciated
    Thanks,
    stock

    first you wil call GUI_UPLOAD in normal way.
    <b>if you are in UNICODE system,</b>
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    CONSTANTS: X_DELIM  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    this X_DELIM is to store HORIZANTAL TAB value.
    <b>if you are in a NON UNICODE SYSTEM,</b>
    you can use,
    data X_DELIM type x value '09'.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = V_FNAME
          FILETYPE                = 'ASC'
        TABLES
          DATA_TAB                = IT_READFILE
        EXCEPTIONS
          FILE_OPEN_ERROR         = 1
          FILE_READ_ERROR         = 2
          NO_BATCH                = 3
          GUI_REFUSE_FILETRANSFER = 4
          INVALID_TYPE            = 5
          NO_AUTHORITY            = 6
          UNKNOWN_ERROR           = 7
          BAD_DATA_FORMAT         = 8
          HEADER_NOT_ALLOWED      = 9
          SEPARATOR_NOT_ALLOWED   = 10
          HEADER_TOO_LONG         = 11
          UNKNOWN_DP_ERROR        = 12
          ACCESS_DENIED           = 13
          DP_OUT_OF_MEMORY        = 14
          DISK_FULL               = 15
          DP_TIMEOUT              = 16
          OTHERS                  = 17.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT.
      ENDIF.
    *--Delete any Empty lines in the input file,if any
      DELETE IT_READFILE WHERE LINE IS INITIAL.
      LOOP AT IT_READFILE INTO X_READFILE.
        SPLIT X_READFILE-LINE AT X_DELIM
                            INTO  X_INPUTFILE-F1
                                 X_INPUTFILE-F2
                                X_INPUTFILE-F3.
        APPEND X_INPUTFILE TO IT_INPUTFILE.
        CLEAR X_INPUTFILE.
      ENDLOOP.
    HERE IT_INPUTFILE IS the internal table with your fields.
    IT_READFILE IS a character type internal table
    data : BEGIN OF IT_READFILE occurs 0,
              LINE(1000) TYPE C,
            END OF IT_READFILE.
    or you can put HAS_FIELD_SEPERATOR = 'X' in calling the above function module.
    Regards
    Srikanth
    Message was edited by: Srikanth Kidambi

  • How to remove Products tab

    Hello everyone, need your help again:
    I have a requirement to change main page to remove Products tab.  My question is
    Where is Products tab coded (in which file)? Can I easily remove it?
    Please advise.
    Thanks, Jin

    Hi Jin,
    I hope you are talking about left side frame where we find 2 tabs "transaction" and "Products" in B2B scenario.
    There are three files involved but you have to do modification in one file only.
    1.) /b2b/organizer-nav-doc-search.jsp
    2.) /b2b/organizer_menu.jsp.inc
    3.) /appbase/tabstrip.inc.jsp
    You are going to do modification in "/appbase/tabstrip.inc.jsp"
    Open "/appbase/tabstrip.inc.jsp" file.
    Find below line under "inactive menu entry"
    String tabItemTxt = WebUtil.translate(pageContext, tabButton.getText(), null);
    write below code to remove "Products" tab.
    <%-- cell with tab text --%>
            <% if (!tabItemTxt.equalsIgnoreCase("Products")) { %>   <%-- Custom IF condition start --%>
              <li class="<%=className%>">
              <a href="<%=tabButton.getLink()%>" title="<isa:translate key="access.tab.unselected" arg0="<%=tabItemTxt%>" arg1="<%=Integer.toString(index)%>" arg2="<%=strstripSize%>" arg3="" /> "
                ><isa:translate key="<%=tabButton.getText()%>" />
                </a>
            </li>
              <% } %>  <%-- Custom IF condition End --%>
    Build it and deploy it to your server now you will not see "Products" tab on left side.
    I hope this will resolve your problem.
    Cheers.
    eCommerce Developer

  • Adding tabs at the header

    Hi Experts,
    I have added some tabs at the header  for Order,Order from Template and Order Template. Problem I am facing is when I am clicking on those tabs it is working fine everywhere except when I am in catalog page.
    Has anybody faced the similar issue. Please advice on this.
    Thanks in anticipation.
    Regards
    Harshmeet Singh

    Hi,
    I have added tabs for Order,Order from template and OrderTemplate in header.jsp which are in the form of links in welcome.jsp. I am not able to go back to any of the pages from catalog page. It is giving an error at the bottom of the page saying location is null or not an object.But the same links are working if I am in any other part of the web shop.
    @Arshi
    Thanks for your input. Will work on it and will let you know if I still face any issues.

  • My recently added tabs are restored only partially after restarting Firefox 4

    I changed the following
    browser.sessionstore.max_tabs_undo;50
    browser.sessionstore.max_windows_undo;12
    At some point after that in the following sequence:
    1. most of recently added tabs and some windows didn't restore after Firefox restart
    2. some recently deleted tabs disappeared from "recently closed tabs" in history
    3. ''recently closed windows'' in history disappeared
    Have anybody changed this and got similar problems? Imho, it's history storage related.

    Are you running Firefox in "Permanent Private Browsing" mode?
    You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"<br />
    To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Permanent Private Browsing mode"
    It is also possible that there is a problem with the files [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    Delete [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.
    Deleting sessionstore.js will cause App Tabs and Tab Groups to get lost, so you will have to create them again (make a note).
    See:
    * http://kb.mozillazine.org/Session_Restore

  • How to permanently remove unwanted tab?

    I want to remove a tab permanently. clicking it will close it, but next time I open Firefox, it's there again. How can I get rid of it??
    Using Mac SnowLeopard.

    Log/sign out of his account on the website. At the top of the page it usually says If not XXXX click here (or something like that). You can also manually sign out. Click the My account and at the bottom of the list is the Not XXXXX Sign out.

Maybe you are looking for

  • How do I remove photos uploaded to iCloud from my iPhone 6 ?

    So I'm wondering how I can keep photos I have uploaded to my iCloud account off my iPhone 6 Plus to free up some disk space. After all, one of the benefits of having cloud storage is to store files remotely so you have more space on your hard drive.

  • MQ Message content conversion using JMS

    I want to use JMS content conversion to convert MQ messages into XML (Idoc). We currently use the R/3 link application to send data to/from MQ to SAP. Each MQ message is one continuous stream of data with no carriage returns or line feed between the

  • My sim is stuck in simtray and simtray is not coming out.What should i do?

    My sim is stuck in sim tray and it is not coming out.What should i do?

  • Batch file to start and stop services

    I've setup a CF Probe on my Development Server to ensure my CF Production server is up and running (services = Apache and CF Application Server). It checks the PROD login page and if it times out in 30 sec the probe fails. I understand I can execute

  • Service Manager 2012 R2 report libraries don't deploy

    So I've got a fresh install of Service Manager 2012 R2 with SQL Server '08 R2 in the 4 server layout, everything on Hyper-V. My issue is this: after registering the data warehouse, everything appears to function normally, the MPSyncJob completes its