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++;
}

Similar Messages

  • "Add New Tab" button does not exist in the Window -Customize Toolbar, and not on my Navigator toolbar. Where can I find one to put on my Navigator toolbar, please?

    I see "Add New Window" but..."Add New Tab" button does not exist in the Window -Customize Toolbar any longer, and not on my Navigator toolbar. Where can I find one to put on my Navigator toolbar, please?
    Thanks

    It's the "+" on the Tab bar. You can move it to the Navigation Toolbar if you prefer. When you start Customize, the + moves to the far right end of the Tab bar. You can drag it where you want (see attached image).
    Any luck?

  • Can I add a button next to the location bar (just like the Home-button) that will open a new tab?

    In Firefox 3 there was a button that would open a new tab. This button was next to my location bar (next to the home, refresh, etc buttons), and also usable when I didn't have any tabs open (unlike the + on the tabbar, which is only there when I turn on my tabbar).
    Although there is a button I can add that will open a new window, I would like to know if it is possible to have similar button that will open a new tab.

    https://support.mozilla.com/en-US/kb/How+to+customize+the+toolbar
    There's a New Tab button in the Customize Palette, just move it to where you want it.

  • Add New Tab Customization on SC Item Level - SRM7

    Hi gurus,
    I have requirement to add new tab on SC Item level. Which should show data from LongText of SC. New TextID created for this development. (Since Requirement is of Vaiable number of fields per Item so cant append Strucutre simply)
    After Initial analysis I see 2 ways to achieve it.
    1. Like Standard SAP way (Similar way SAP did for standard Tabs)
    - But its really complicated at Mapper Class & PDO Layer. Any Docs ??
    2. Tab Enhancement Framework - Use of Table : /SAPSRM/C_TS_EXT
    - With this I m able to call Z component. But not able to co-relate it with SC item level.
    - How to pass Item GUID to Z component in proper way??
    -  How to link Z components data SAVE event with standard SAVE button of FPM or SC ??
    Is there any other better way ??
    Is it possible via Table Extension ?? what are steps to do it ??
    Thanks
    PK
    Edited by: pkumthek on Nov 2, 2010 4:35 PM

    Hi pkumthek,
    I do suggest you not try to add new tab on SC item level. We cost 4 people month to accomplish this little function...A better way is adding a hyper-link on item level which could navigate to a pop-up window. You can finish your logci in the pop-up window and it will cost pretty less. Just for your information.

  • How can i add new tab in Business Partner

    hi every body,
    Present i am working on SAP CRM 3.0 version. i need to add new tab in BP.  Here EEWB not available. How can i add new tab?

    Hi  babu,
    you can add new tab in Buisness partner with the help of screen configaration functionality,in screen configaration u select first bp role (sold to party or retailer etc) and click on process screen sequence  and again click on overview and u will get fields right side of the screen, there u will see the field "new screen" click on that and add description for new tab and click on continue,save the document
    now u will again create a bp with modified bp role u will see changes means u will see new tab page on perticular bp role
    i hope this is helpful
    Rewards points if helpful
    Thanks&regards
    kishore kumar

  • How to add new tab under tansaction tab

    Hi Team,
    I would like to add a new customized tab to the "Transaction Data" screen in transaction CRM_DNO_MONITOR.
    It currently has the following standard tabs:
    Overview
    SAP Attributes
    SAP Notes
    Solution Database
    Partners
    Actions
    Status
    Documents
    and I would like to add a new one with 'My Data'
    We want to add some Ztable fields  on this separate tab - things like-
    Fields Names :
    1.     Change type
    2.     Change Test Procedure
    3.     Fall back option
    4.     Impact Assessment
    5.     Module
    6.     Business Unit Impact
    7.     Estimated Cost
    8.     System Performance
    9.     Risk
    Can anyone give me any pointers on how to proceed ?
    Thanks & Regards,
    srikumar.anamala
    Edited by: srianamala on Apr 30, 2010 6:57 AM

    Hi,
    I think for that you need a user exit or BADI. Like most of the standard transaction you will find user exit or BADI to add new tab.
    For example MM06E005
    You can create custom fields in the includes CI_EKKODB and CI_EKPODB . Create yours screen 0111.
    EXIT_SAPMM06E_016, EXIT_SAPMM06E_018  use to export and import data.
    See BADI: ME_PROCESS_PO_CUST
    Thanks,
    Abhijit

  • How to add new tab page to equiment ?

    Dear Guru's
    i created the new equipement category K by coping the standard S.when i am creating the equipment while using equipment category S i am getting tab pages General,Location,organization,structure,Sales and Distribution.
    But while using the equipment category K for creating the new equipment i am getting the tab pages General,Location,organization,structure 4 only.
    why the 5 one Sales and Distribution is not coming ?
    how to add new tab page like Partners ?In that fields like sold to party,ship to party ?
    Could anybody help me in this regards
    Thank you
    suribabu

    In Equipment category creation config in IMG, check for the View Profile for both the equipment category S & K.
    For adding new tab, follow the IMG path.
    PM & CS => Master data => Technical Objects => General Data => Set view profiles for Technical objects
    Select the View profile which has been assigned to your equipment category & click Activity & layouts of views. In that screen, under seq.no, select the Partners.
    Do the same for other requried tabs based on your requirement.
    If there are same profile assigned to both equipment category, go to equipment creation creation => Edit => view selection. There you will find the required tabs.

  • How to add new tab to GL Accounts Determination Form

    Hello Professionals,
    I want to add new tab to GL Accounts Determination. This form can't be opened using screen painter in SAP, Also, i have tried several codes to add it through UI API but with no progress so far.
    How can i do this?
    Thanks in advance

    Hi Karem,
    Use this code in your Item Event on G\L account determination form.
    and Use it in FormLoad  Event  [SAPbouiCOM.BoEventTypes.et_FORM_LOAD] and
    Before Action=False
            Dim oitem As SAPbouiCOM.Item
            Dim oextitem As SAPbouiCOM.Item
            Dim oPanel As SAPbouiCOM.Folder
            objform.DataSources.UserDataSources.Add("UD_FDR", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20)
            oitem = objform.Items.Add("TAB", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
            oextitem = objform.Items.Item("10000008") 'Inventory Tab'
            oitem.Height = oextitem.Height
            oitem.Width = oextitem.Width
            oitem.Left = oextitem.Left + 100
            oitem.Top = oextitem.Top
            oPanel = oitem.Specific
            oPanel.Caption = "New Tab Folder"
            oPanel.Pane = 10
            oPanel.DataBind.SetBound(True, "", "UD_FDR")
            oPanel.GroupWith(10000008)
    I hope it will help.
    Thanks & regards,
    P.T.Sampath

  • How to add new tab screen in transaction BP

    Hi,
       Please let me know How to add new tab screen in transaction ukm_BP. Is there any SPRO configuration needed for this?
    Thanks,
    Debi.

    Hi,
    You may also try the exits available with the MIGO transaction. To find exits you can use the fillowing code by giving tranasaction code as input.
    REPORT  zrmexitfinder                               .
    TABLES: modsap, modact, tstc.
    PARAMETERS: input1 LIKE tstc-tcode DEFAULT ' ',
                input2 LIKE modsap-typ DEFAULT ' '.
    DATA: search1(6),
          search2(3),
          search3 LIKE modsap-member.
    DATA : first_row VALUE 'Y'.
    CONCATENATE: '%' input1 '%' INTO search1,
    '%' input2 INTO search2.
    SELECT * FROM tstc WHERE tcode LIKE search1.
      first_row = 'Y'.
      CHECK tstc-pgmna NE space.
      CONCATENATE '%' tstc-pgmna '%' INTO search3.
      SELECT * FROM modsap WHERE typ LIKE search2
      AND member LIKE search3.
        SELECT SINGLE * FROM modact WHERE member = modsap-name.
        IF first_row EQ 'Y'.
          WRITE: /0 tstc-tcode, 6 tstc-pgmna, 16 modsap-name, 32 modsap-typ,
                 45 modsap-member, 70 modact-name.
          first_row = 'N'.
        ELSE.
          WRITE: /16 modsap-name, 32 modsap-typ, 45 modsap-member, 70 modact-name.
        ENDIF.
        CLEAR : modsap, modact.
      ENDSELECT.
      IF sy-subrc NE 0.
        WRITE : /0 tstc-tcode, 6 tstc-pgmna, 30 'No exits found'.
      ENDIF.
      CLEAR tstc.
    ENDSELECT.
    END-OF-SELECTION.
      CLEAR: search1, search2, search3.
    Regards,
    Renjith Michael.

  • Add new TAB in ML81N Tcode..

    Hi Experts,
    I am new for screen exits...
    Can any one tell me how to add new tab in ML81N tcode in detail...
    Please waiting for your great answers...
    Thanks in advance,
    Kruthik
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Dec 1, 2011 2:03 PM

    Hi,
    Search SDN before posting a question. There are lots of threads on this topic.
    Have a look at this thread : Adding a new tab in MM01
    Read SAP Notes 38299 & 44410 as suggested in that thread.
    Thanks & Regards,
    Faheem.

  • How to add new tab after reason for rejection tab using tcode va01

    Hello,
    how to add new tab after reason for rejection tab using tcode va01.

    Hi,
    You can check this link...
    Hope it will be helpful to you.
    [https://forums.sdn.sap.com/click.jspa?searchID=23016273&messageID=6825861]
    [http://www.sapdevelopment.co.uk/enhance/fexits.htm]
    -Maharshi
    Edited by: Maharshi Vyas on Mar 3, 2009 12:45 PM

  • Add new tab of long text to production order

    Hi all
    i need to add new tab of long text to production order, which will be blocked for changes.
    anyone can help with this?
    thanks.

    Yossi,
    The purpose of long text is so that business users can add additional information while processing the order so that everyone can check the text.
    Please tell us why do you want to block the production order text? Also why do you need a new tab for long text? and where do you want that information to be stored?
    -Swapnil

  • How add new tab after reason for rejection tab using tcode va01 using badi

    I want to add new tab in va01 using badi. I search badi ->  badi_sd_update_plval  at the time of implementation it  ask about access key.
    which is suitable badi for va01 enhancement.
    Any screen exit is available for this enhancement.

    You need to implement BADI through SE19. Refer below link for details
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf4940e11d295df0000e82de14a/frameset.htm
    Hope this helps..

  • How add new tab after reason for rejection tab using tcode va01

    Hello,
           How to add new tab after Reason for Rejection tab using tranzaction code VA01.
    pls suggest solution.

    I don't think you can add a tab after reason for rejection tab. There are custom tab, which you can use for your convenient, given by SAP. You can look into the below details:
    Program : SAPMV45A
    Screen: 8459(Item) and 8309(Header).
    Kuntal.

  • Web Viewer - getting buttons to open in a new tab or window

    I am trying to get a button to open in a new tab or window in the DPS web viewer.
    The options when creating a button are:
    Open link in folio
    Open link in device browser
    Both which do not work when we export the web viewer.
    I know it is possible as Adobe are using this function for their Inspire magazine. This does not seem to be html either that they are using. See link here - at the bottom of the page: Adobe Inspire Magazine October 2014: The Truth in a Face
    Any help with this issue would be highly appreciated.

    There is a parameter on creating the iFrame called externalLinksOpen. They can set it to 'window', as it defaults to inline, which opens it in the current window. It's documented here:
    http://www.adobe.com/devnet-docs/digitalpublishingsuite/ContentViewerForWebSDK-2.0/classes /FrameService.html#method_createFrame
    There is also a demo linked from our 'What's New' section under 'External Link for Embedded Viewer' at http://www.adobe.com/devnet-docs/digitalpublishingsuite/ContentViewerForWebSDK-2.0/modules /What's%20New.html.

Maybe you are looking for

  • Trying to execute shell process in Linux

    Hi. I'm trying to execute a simple command in the form of 'bash -c "ls ~root ~"' from within java. I've tried using both the java.lang.Runtime.exec() methods and the java.lang.ProcessBuilder class but both produce the same error message (which I get

  • Change Teminal display resolution

    Hi were at a point where we are using a group of terminal's connected to a 2008 server hosting other terminals in other rooms. We need our resolution to be 800 x 600 for our software to operate correctly but the IT consultant says its not possible to

  • How to make perfect intersection of selections?

    So I have 2 alpha channels. When I try to make a new selection intersecting those 2 alpha channels, there is always about 1 px that is not selected... In the image the black pixels are the new selection, and red pixels are one of the alpha channels.

  • Aperture 2 Color Profiling....please help

    Hi I have a MBP and aperture...I did the following setup 1) Calibrated my Monitor with a spyder (used gamma2.2 and neutral) I doubled on this website that the calibration is ok http://www.drycreekphoto.com/Learn/monitor_calibration.htm 2) on Aperture

  • Why do I need to give my credit card details to get a free app?

    I just want a free app from Twitter, but cannot seem to download it without giving my card details. Is this correct?