Two tales in a single tab

Hi,
How can I use two tables in a tab.

Option 1: Use GridLayout on tab, add tables
Option 2: Use JSplitPane on tab, add tables
Here's bothimport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test extends JFrame {
  public Test() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    JTabbedPane jtp = new JTabbedPane();
    content.add(jtp, BorderLayout.CENTER);
    JPanel gridTab = new JPanel(new GridLayout(1,2)),
            splitTab = new JPanel(new BorderLayout());
    jtp.add("GridLayout",gridTab);
    jtp.add("SplitPane", splitTab);
    JSplitPane split = new JSplitPane();
    split.setDividerLocation(200);
    splitTab.add(split);
    String[] str = {"Zero","One","Two","Three","Four"};
    String[][] head = new String[4][str.length];
    String[][][] data = new String[head.length][20][head[0].length];
    for (int h=0; h<head.length; h++) {
      for (int j = 0; j < head[h].length; j++) {
        head[h][j] = ""+(h+1)+"-"+str[j];
        for (int i = 0; i < data[h].length; i++) {
          data[h][j] = "T" + (h + 1) + "-R" + i + "-C" + j;
JScrollPane jsp = new JScrollPane(new JTable(data[h], head[h]));
if (h<2) gridTab.add(jsp);
else split.add(jsp, h==2?JSplitPane.LEFT:JSplitPane.RIGHT);
setSize(500,500);
setVisible(true);
public static void main(String args[]) { new Test(); }

Similar Messages

  • Dispaly of two tables for a single tab in tabstrip

    Hi Experts,
    I have three tables,one is the consolidated table of another one and the third one is completely different but the requirement is ,
    for a SINGLE TAB click of a tab strip both the tables which are related have to be displayed
    and for the the third table a new tab has to be clicked.
    ,i know to display only one ui element for one tab .
    please help me out with this problem of displaying of two tables for a single tab

    Hi Shanmukha,
    Suppose you name of name of tables which need to be displayed in one tab is table 1 and table 2. To get this you can try these steps:
    method 1:
    - create  a view with 2 tables in it i.e table 1 and table 2. create a view container UI element in tab strip and embed this view in it.
    method 2
    - create  view1 containing table 2 only.
    - create view 2 containing table 1 and a view container UI element. Embed view 1 in the view container of this view. Now your view 2 contains both the tables.
    - In the tab strip's tab, create another view container UI element and embed view2 in it.
    I hope it helps.
    Regards
    Arjun

  • Displaying two blocks in a single screen

    Hi all,
    I want to dispaly two screens in a single with as-usual properties.
    Please give your suggestions with steps.
    Thansk in advance,
    Regards,
    Balaaji.

    hi balaji ,
    create a main screen and in which  create two sub screens . like this .
    REPORT ZSUBSCREEN.
    TABLES: USR02,       "Logon data
             SSCRFIELDS.  "FIELDS ON SELECTION SCREENS
    SUBSCREEN 1
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
        SELECT-OPTIONS: USERNAME FOR USR02-BNAME.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN END OF SCREEN 100.
    SUBSCREEN 2
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
        SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN END OF SCREEN 200.
    SUBSCREEN 3
    SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.
        SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN END OF SCREEN 300.
    STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
    SELECTION-SCREEN: FUNCTION KEY 1,
                       FUNCTION KEY 2.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,
                       END OF BLOCK SUB.
    START-OF-SELECTION.
         SELECT * FROM USR02 WHERE BNAME IN USERNAME
                               AND ERDAT IN LASTLOGI
                               AND CLASS IN CLASSTYP.
            WRITE: / 'User ', USR02-BNAME,
                     'Last Login Date ', USR02-TRDAT,
                     'Last Login Time ', USR02-LTIME,
                     'CLASS ', USR02-CLASS.
         ENDSELECT.
    END-OF-SELECTION.
    INITIALIZATION.
    SCREEN ICON LEFT AND RIGHT
       SSCRFIELDS-FUNCTXT_01 = '@0D@'.
       SSCRFIELDS-FUNCTXT_02 = '@0E@'.
       SUB-PROG = SY-REPID.
       SUB-DYNNR = 100.
    AT SELECTION-SCREEN.
       CASE SY-DYNNR.
         WHEN 100.
           IF SSCRFIELDS-UCOMM = 'FC01'.
             SUB-DYNNR = 300.
           ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
             SUB-DYNNR = 200.
           ENDIF.
         WHEN 200.
           IF SSCRFIELDS-UCOMM = 'FC01'.
             SUB-DYNNR = 100.
           ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
             SUB-DYNNR = 300.
           ENDIF.
         WHEN 300.
           IF SSCRFIELDS-UCOMM = 'FC01'.
             SUB-DYNNR = 200.
           ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
             SUB-DYNNR = 100.
           ENDIF.
       ENDCASE.
    regard,
    sandeep patel
    reward point if helpful

  • How can we give two name for a single material ??

    Hi friends
    how can we give two name for a single material ??
    e.g.. if single material is sold to different customer by different names
    then how can we do that ??

    Yes
    you can achieve it thro CMIR in T code VD51
    Go to T code VD51 choose that customer and material combination and click on to its details blue lens on application tool bar
    In the screen which is coming ,enter your description in the CUSTOMER DESCRIPTION tab the second one and save
    Now create a sales order and see
    Your requirement will be fulfilled
    If a material is pen description is ball pen in material master and for customer A you have defined it as Pen 1 and description as Super ball pen in VD51
    If a material is pen description is ball pen in material master and for customer B  you have defined it as Pen 1 and description as  VerySuper ball pen in VD51
    Now in sales order the description will appear as Super ball pen for Customer A
    Now in sales order the description will appear as Very Super ball pen for Customer B
    Hence the material pen whose description is ball pen in MMR will appear as super ball pen for customer A and very super ball pen for customer B
    Hope you have checked the field info record in VOV8
    I have tried this tested this and getting it
    Regards
    Raja
    Edited by: ramanathan raja on Dec 8, 2008 5:54 PM

  • Can we call two layouts for a single script?

    Can we call two layouts for a single script?
    Where dow e assign print program to a script?
    in NACE transaction is it possible.......
    Thanks in advance.
    Regards.
    Abhilash.

    Hi Abhilash.
    Greetings for the day.
    U can use one script in diffrent programs.
    Yea u can do it in NACE transaction.
    procedure would b as foloows:-
    1.NACE
    2.Select the apllication
    3.Output types (press tab).
    4.again selet the output type which u require
    5.then press "procedure routines"
    here u can give the program name and fom name.
    plz reward if found helpful.
    regards
    prashant tiwari

  • After reverting to Firefox 3.6 I have lost the ability to close a webpage (down to an empty tab) when I have only one tab open. Where did the little "x" go on the single tab???

    I like to be able to close the webpage I am viewing when I am finished, when there is only one tab open, so that Firefox is empty when I next want to browse the web. After upgrading to 5.0 and finding I hated it, I downgraded back to 3.6 and now the little "x" on the single tab is gone. It still appears when I have multiple tabs open, but not when there is just one. What happened? How do I get it back?

    Thank you, but I already have "always show tabs bar" set.
    Also, I have two computers and the other is running the exact same version of Firefox, and the exact same theme, but it does not have this problem.
    To make sure I'm being clear: there is an "x" on each tab that allows me to close it when I have multiple tabs open. When I have only one tab open, there is no "x"; so in order to close the webpage I have to open another empty tab, and then close the first. My other computer has the "x" to close the tab visible even when there is only one tab so that I can close the page and have an empty (marked "(untitled)" tab). Please help!

  • Spark TabBar: How to disable single tabs?

    Hi,
    I wrote already a bug report about this issue, but no one responded.
    For an application I need to disable and enable tabs on the fly. So I built a TabBar with a ViewStack as a dataProvider and NavigatorContent as the single items. Then I tried disabling a NavigatorContent component so that the tab is disabled. But it is still enabled and can be selected. How can I disable a single tab? Do I have to create a custom solution or wait until the TabNavigator component is ported to Spark? (Maybe I should fall back to the halo component)
    Also the enabled property of the TabBar doesn't disable the tab content. So there seems to be no connection between the data and the TabBar.

    If you find this post looking for the answer, I posted two options here: http://forums.adobe.com/message/4153359#4153359
    =D

  • Is it possible to view your current history for a single tab in safari lion

    Is it possible to view your current history for a single tab in safari lion?

    Not once the tab has been closed. If it hasn't, clicking and holding the Back button will display the titles of recently visited sites in that tab.
    (68280)

  • TWO ERRO ORA-01427: single-row subquery returns more than one row

    Hi,
    I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
    TWO ERRO ORA-01427: single-row subquery returns more than one row
    Not sure what going on...any help appreciated.
    Below is the select statement:
    SELECT DISTINCT PSE.PARENT_POSITION_ID,
    (SELECT DISTINCT PPD1.SEGMENT2
    FROM PER_POSITION_DEFINITIONS PPD1,
    HR_ALL_POSITIONS_F HAPF2,
    PER_POS_STRUCTURE_ELEMENTS PSE2
    WHERE TRUNC(SYSDATE) BETWEEN
    HAPF2.EFFECTIVE_START_DATE AND
    HAPF2.EFFECTIVE_END_DATE
    AND PPD1.POSITION_DEFINITION_ID =
    HAPF2.POSITION_DEFINITION_ID
    AND
    HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
    AND PSE2.PARENT_POSITION_ID =
    PSE.PARENT_POSITION_ID
    AND ROWNUM = 1) SEGMENT2,
    (SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
    PAPF1.LAST_NAME CHIEF_NAME
    FROM PER_ALL_PEOPLE_F PAPF1,
    PER_ALL_ASSIGNMENTS_F PAAF1
    WHERE TRUNC(SYSDATE) BETWEEN
    PAPF1.EFFECTIVE_START_DATE AND
    PAPF1.EFFECTIVE_END_DATE
    AND TRUNC(SYSDATE) BETWEEN
    PAAF1.EFFECTIVE_START_DATE AND
    PAAF1.EFFECTIVE_END_DATE
    AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
    AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
    AND ROWNUM = 1) CHIEF_NAME
    FROM PER_POS_STRUCTURE_ELEMENTS PSE,
    HR_ALL_POSITIONS_F HAPF,
    PER_POSITION_DEFINITIONS PPD
    WHERE PSE.SUBORDINATE_POSITION_ID = 52744
    AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
    HAPF.EFFECTIVE_END_DATE
    AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
    AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
    Thanks
    PK
    Edited by: user539616 on Jun 30, 2009 6:30 PM

    Hi,
    The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
    This is your query (formatted):
    SELECT DISTINCT PSE.PARENT_POSITION_ID,
                    (SELECT DISTINCT PPD1.SEGMENT2
                       FROM PER_POSITION_DEFINITIONS   PPD1,
                            HR_ALL_POSITIONS_F         HAPF2,
                            PER_POS_STRUCTURE_ELEMENTS PSE2
                      WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
                            HAPF2.EFFECTIVE_END_DATE
                        AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
                        AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
                        AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
                        AND ROWNUM = 1) SEGMENT2,
                    (SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
                       FROM PER_ALL_PEOPLE_F      PAPF1,
                            PER_ALL_ASSIGNMENTS_F PAAF1
                      WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
                            PAPF1.EFFECTIVE_END_DATE
                        AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
                            PAAF1.EFFECTIVE_END_DATE
                        AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
                        AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
                        AND ROWNUM = 1) CHIEF_NAME
      FROM PER_POS_STRUCTURE_ELEMENTS PSE,
           HR_ALL_POSITIONS_F         HAPF,
           PER_POSITION_DEFINITIONS   PPD
    WHERE PSE.SUBORDINATE_POSITION_ID = 52744
       AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
       AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
       AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When closing any single tab exits firefox entirely why? just started happing

    Just rebooted system (Windows PC) on return from holiday.
    When closing ant tab instead of that single tab being closed, Firefox closes completely even though I have not touched the main "X" how can I reset or resolve this issue?
    Rich.

    Courtesy '''jscher2000''' -
    < (1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste "tabs" and pause while the list is filtered
    (3) Double-click the browser.tabs.closeWindowWithLastTab preference to switch its value from true to false.
    Press Ctrl+n to open a new tab, then Ctrl+w to close the tab. Helpful? >

  • Merging two records in a single record for the same matnr,werks and bwart.

    Hi I have a requirement to merge two records into one single record using the quantity field from MSEG table.
    I am selecting two records from the table MSEG. Now for these two records i have to add the quantity values into one variable.
    Then there should be only one record for the same matnr,werks,bwart.
    Any suggestion would be appreciated.
    Regards,
    Amit

    hi,
    You can COLLECT statement only if all non key fields are numeric.
    This statement Adds all such fields and give us a single record.
    Regards
    Sumit Agarwal

  • Two Graphs in a single screen

    Hi Experts,
    I want to display two graphs in a single screen. It should be a pie chart.
    Currently I did one pie chart using GRAPH_MATRIX_2D.
    It is working fine.
    But i want to display another PIE Chart within the same screen.
    Can anyone help me sort out?
    Thanks in advance

    Hi Vimal,
    Go throungh the following code. it will help you.
    REPORT Z_3DGRAPH.*structure declaration for performance measurementTYPES: BEGIN OF ty_performance,
          company(15) TYPE c,
          q1 TYPE i,
          q2 TYPE i,
          q3 type i,
          q4 type i,
          END OF ty_performance.*structure declaration for options table
    types : BEGIN OF ty_opttable,
            options(30) TYPE c,
            END OF ty_opttable.*Internal table and work area declarations
    DATA: it_performance TYPE STANDARD TABLE OF ty_performance,
          wa_performance TYPE ty_performance.DATA : it_opttable type standard table of ty_opttable,
           wa_opttable type ty_opttable.*initialization event
    INITIALIZATION.*start of selection event
    START-OF-SELECTION.*clearing the work areas
    CLEAR WA_PERFORMANCE.
    CLEAR wa_opttable.*appending values into the performance internal table
    wa_performance-company = 'Company A'.
    wa_performance-q1      = 78.
    wa_performance-q2      = 68.
    wa_performance-q3      = 79.
    wa_performance-q4      = 80.append wa_performance to it_performance.wa_performance-company = 'Company B'.
    wa_performance-q1      = 48.
    wa_performance-q2      = 68.
    wa_performance-q3      = 69.
    wa_performance-q4      = 70.append wa_performance to it_performance.wa_performance-company = 'Company C'.
    wa_performance-q1      = 78.
    wa_performance-q2      = 48.
    wa_performance-q3      = 79.
    wa_performance-q4      = 85.append wa_performance to it_performance.*appending values into the options internal tablewa_opttable-options = 'P3TYPE = TO'.
    APPEND wa_opttable TO it_opttable.wa_opttable-options = 'P2TYPE = VB'.
    APPEND wa_opttable TO it_opttable.wa_opttable-options = 'TISIZE = 1'.
    APPEND wa_opttable TO it_opttable.*calling the graph function module
      CALL FUNCTION 'GRAPH_MATRIX_3D'
        EXPORTING
          col1      = 'Quarter 1'
          col2      = 'Quarter 2'
          col3      = 'Quarter 3'
          col4      = 'Quarter 4'
           dim1      = 'In Percentage%'
          set_focus = 'X'
          titl      = 'Company Performances'
        TABLES
          data      = it_performance
          opts      = it_opttable
        EXCEPTIONS
          others    = 1.
    Regards,
    Rajesh Kumar

  • How to hide a single tab in tabcontrol

    Hi, I want to hide a single tab on a multi-tab tabcontrol based on login. If the particular bit is set, show 1st and 3rd and so on. I just gone through help files.I couldn't find any.
    Raj. 
    Solved!
    Go to Solution.

    EightBit wrote:
    How did you make the page property with "PageVis." I create a property node but then can only link to things in Pane, aka I can't find how to link to Page
    8bit, you should be aware you replied to a 4 yeaar old solved thread (Not the best way to attract attention- next time feel fre to start a new thread)
    Try this:
    A Tab is a container for "Pages" the Pages each have a "Page.visible" property.  since the pages are in the tab container you cant access there properties directly from the "Pane"
    Jeff

  • How to join two hiearchy in a single report

    Hi,
        I have two hiearchyes on two master data objects, How best can i  customise to view this two hiearchies in a single report.

    Hi Nagendra,
    Find the below links and blogs..
    May be this will helps you
    A BW hierarchy has the following properties:
    Hierarchies are created for basic characteristics
    Hierarchies are stored in special master data tables. They behave in a similar way to master data,
    and can therefore be used and modified in all Info Cubes.
    You can define several hierarchies for a single characteristic.
    A hierarchy can have a maximum of 98 levels.
    http://help.sap.com/saphelp_nw70/helpdata/EN/80/1a670fe07211d2acb80000e829fbfe/frameset.htm
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b07849c7-3a5b-2b10-7586-c431d300a578
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20a709c1-0a8e-2a10-21b4-f779728c63bf
    /people/vijay.vijayasankar/blog/2008/03/13/crm2007-who-gets-to-see-what--some-strategies-for-managing-internal-and-external-users-part-1
    /people/shafiq.rehman3/blog/2008/01/22/hr-interface-toolbox--pu12
    /people/kamal.khanna/blog/2008/07/09/managing-data-of-most-valuable-asset-of-an-organization-employees
    Regards
    Sudheer

  • How to Insert two queries in a single workbook in BI 7 ?

    Hi,
               I am trying to insert two queries in a single workbook. The queries are of Accounts Receivable.I have inserted one query in a workbook , but am not able to proceed to inserting the second query. In BEx analyzer, in design mode , using analysis grid , i tried inserting the second query but when saving and running, i am getting message " Variables are present, change their values " . should i maintain same variables for two queries ? i am stuck up. please explain me as how can this be done.
    Roja.

    Hi,
    If you get the message "Variables are present, change their values" ,it means that the query which you inserted having variables.
    You just click the "Change Variables" icon in the Analysis Toolbox,which will invoke the variable screen.
    Set the values in the variable screen and click OK.
    Now you will be able to see the data in the grids based on the values selected in the variable screen.
    Both queries data will be displayed in the workbook.
    Let me know in case of any clarifications!
    Rgds,
    Murali

Maybe you are looking for