Horizontal scroll Bars not coming in JTable

Hi,
If a user streches any column of the jtable to the right such that its values are not visible properly. Then should the horizontal scroll bar come in the scrollpane in which table is there.??
If Yes then how can I do it?
I have seen when no of rows becomes more than the display area of the table then vertical scrollbar are coming automatically. but not Horizontal scroll bars.
Please help

sorry for my previous mistype, here is the right solutions to your problem.
As default the JTable will auto resize your column width, if you want horizon scrollbar
you must do following below steps:
JTable tableview = new JTable (model) ;
tableview.setAutoResizeMode (JTable.AUTO_RESIZE_OFF) ;
JScrollPane scrollpane = new JScrollPane (tableview,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED) ;
JPanel p ;
p.add (scrollpane) ;
This can works for you !

Similar Messages

  • Horizontal scroll bar not appeating in af:treeTable

    We have an af:treeTable component in a popup with two af:column.
    Issue:
    1. af:treeTable is not showing horizontal scroll bar. When i set the width to a fixed value say 1000 on af:column c171, it shows scroll bar but the size is fixed.
    This is not the solution, because if the length of #{node.TerrDimMemberHierarchy} exceeds this size again some portion of it becomes invisible.
    Question:
    1. How can i make horizontal scroll bar appear in tree table. And also it should grow or shrink depending upon the length of #{node.TerrDimMemberHierarchy}
    data.
    <af:treeTable rowBandingInterval="0" id="tt2"
    fetchSize="25"
    inlineStyle="width:38em; height:28em; border-width:1px; border-style:groove;"
    partialTriggers="::dimensionDropDown ::searchButton ::cb5"
    rowSelection="multiple"
    value="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeTableTreeModel}"
    var="node"
    visible="#{pageFlowScope.searchString != null ? (pageFlowScope.viewInHierarchyBtnLbl == null ? true : false) : false}"
    columnStretching="column:c171"
    binding="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeTable}"
    summary="#{salesterrmgmtterritoriesuiGenBundle['OLabel.AvailableDimensionMembers']}"
    immediate="true"
    selectionListener="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeListener}"
    styleClass="AFStretchWidth">
    <f:facet name="nodeStamp">
    <af:column sortable="false" id="c14"
    rowHeader="unstyled"
    headerText="#{salesterrmgmtterritoriesuiAttrBundle['ColAttr.Name.DimensionName.MOTTERRDIMENSIONSVL.NAME']}">
    <af:outputText value="#{node.Name}" id="ot15"/>
    </af:column>
    </f:facet>
    <af:column sortable="false" id="c171"
    headerText="#{dlBndl.PATH}"
    styleClass="AFStretchWidth">
    <af:outputText value="#{node.TerrDimMemberHierarchy}"
    id="ot16"/>
    </af:column>
    </af:treeTable>
    Edited by: sekare on Aug 29, 2011 4:01 AM

    can u remove the styleClass="AFStretchWidth" for af:column
    AFStretchWidth is for table or treetable to stretch.. not for columns
    <af:column sortable="false" id="c171"
    headerText="#{dlBndl.PATH}"
    styleClass="AFStretchWidth">

  • Horizontal Scroll Bar not displaying

    Hi,
    We have a page with many recursive tables for alignment.
    We have a lot of graphs displayed horizontally, so that we need to scroll the page horizontally.
    We happened to change the layout and suddenly we are missing the horizontal scroll bar !!
    We could not scroll to see the hidden page details.
    This happens only in IE6, IE7. Firefox, Mozilla displays it with horizontal bars
    Does anybody knows as what the problem could be ??
    - Mohan

    Horizontal Scrollbar in base window... has nothing to do with Framework, its a browser feature and should appear automatically. I m still wondering what must have caused in ur cause.Can u upload the page screenshot on any pic website, would like to have a look !
    There is CSS work around for this but it would be difficult to inject it in a OAF page!Anyways upload the screenshot.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Horizontal scroll bar not appearing-Alert report screen

    Hi All,
    I have an agent setup which shows alerts and a report is fed as an input/delivery content. The report is fairly big with many columns and cannot fit in the standard alert screen hence need a horizontal scroll bar to view all the columns. But unfortunately there are two vertical scroll bars which are appearing and no horizontal scroll bar. Could the experts please let me know if this is a bug or is there any configuration that I am missing?
    OBIEE version: 11.1.1.5
    Any help would be appreciated.
    Thanks,
    Vikram

    Hi,
    Sorry for the delay in response. The issue was because of IE7 version. Its a bug.
    Thanks,
    Vikram

  • Horizontal scroll bar not showing in PO

    Hi Experts,
    I'm unable to see the Horizontal scroll bar in PO item overview..so unable to see all the columns..is there any setting for that ???so that I can use it again ...

    Hi,
    Click 'Table Control Settings' icon (press the button on the top-right
    hand of the item details area you're referring to - the icon is 3
    columns with a a yellow first column)
    In the 'Administrator' area there is a setting here in the section
    'Further settings', with a field 'No. of fixed columns'.
    Check the value here.Make it to 2 and activate.You should be able to see the scroll bar now.
    Regards,
    Ashwini.

  • ALV-Horizontal scroll bar not working

    Hi,
    I have one ALV.  There are 3 fields.  First 2 fields are key fields and the third field is of type string with length 3000.  The problem is I cant scroll the grid horizontally though the scroll bar is there.  
    where to use this method set_scroll_info_via_id() ?
    Regards,
    Sunil

    HI Sunil,
    If it is normal ALV the Vertical and Horizantal bars will enable automatically...
    while fililng the filed catalog you use the parameter "OPTIMIZE"....
    ie
    wa_filedcat-COL_OPT = 'X'.
    for better understanding..refer to this.
    Re: Cursor in ALV container
    hope it works..
    Thanks!
    Edited by: Prasanth on Mar 23, 2009 11:32 AM
    Edited by: Prasanth on Mar 23, 2009 11:36 AM

  • Scroll bars not coming in a scrollpane

    Hi,
    I have a splitpane on which i have added a scrollpane. On the scrollpane i have added a panel on whcih i have added an image.
    now when i run the program, and i decrease the resolution, the size of the image gets bigger and it gets truncated by the toolbar of the frame. whereas what i expected was that the scrollbar shuld have come and i shuld have been able to see the image by using hte scroll bars
    anyideas on what went wrong?
    thanx
    deepak saini

    Hi,
    the thing is confusing me actually.. Now i am running the applicaiton at a lower resolution and trying to fit the things.
    everything comes fine but when i raise the splitpnae on which i have the scrollpane, the scrollpane completely covers the whole frame and the toolbar disappears.
    I have copied the lines of code ....have a look and do tell me if u see somethiing wrong!!!
    panelTop = new JPanel();
    panelTop.setLayout(new BorderLayout());
    textArea = new JTextArea(300, 100);
    textArea.setCaretPosition(textArea.getDocument().getLength());
    scrollPane = new JScrollPane(textArea);
    scrollPaneTop = new JScrollPane(panelTop);
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPaneTop, scrollPane);
         splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(480);
                        Dimension minimumSize = new Dimension(200,200);
                        //panelTop.setMinimumSize(minimumSize);
                        Dimension minimumSize2 = new Dimension(50,150);
                   scrollPaneTop.setMinimumSize(minimumSize2);
                        panelTop.setPreferredSize(minimumSize);
                        panelTop.setBounds(20,250, 200, 200);
    //Provide a preferred size for the split pane
         splitPane.setBounds(10,250, 200, 400);
    panelTop.setVisible(true);
    JPanel toolBarPanel = new JPanel();
    toolBarPanel.setBounds(1,1,750,50);
    toolBar = new JToolBar();
    toolBarPanel.add(toolBar);
    toolBarPanel.setVisible(true);
    getContentPane().add(toolBarPanel);
    toolBar.setBackground(Color.red);

  • BP Transaction Horizontal scroll bar is not working

    Hi,
    Horizontal Scroll Bar Not working for Marketing Attribute after Upgradation from Crm 6.0 to EHP 7.02
    Scroll bar need to be Enabled or active Please suggest any OSS Note or any Idea in doing this .Please help me out
    Thanks & Regards
    Srinivas

    Hello,
    Not sure to understand the issue here. If you are using CRM7 EHP2, you should user WebUI/IC to manage BP. SAP GUI is no longer supported.
    Best regards,
    Sylvain AGUETTAZ

  • Horizontal Scroll Bar does not show

    I have a method which creates a table with values and displays it in a dialog. However, the horizontal scroll bars do not appear, even though there is are columns that are not seen in the view. Here is my code:
         private void setTable()
              Object columns[] = headerLST.toArray(),
                        rows[][] = new Object[rowLST.size()][headerLST.size()];     
              for(int x = 0; x < rowLST.size(); x++)
                   java.util.List list1 = (java.util.List)rowLST.get(x);
                   for(int y = 0; y < list1.size(); y++)
                        rows[x][y] = (String)list1.get(y);     
              DefaultTableModel tValues = new DefaultTableModel(rows, columns);
    JTable tableA = new JTable(tValues);
         tableA.setRowHeight(27);
                   tableA.setRowSelectionAllowed(false);
                   tableA.setColumnSelectionAllowed(false);
                   tableA.setFont(new Font("Dialog", Font.BOLD, 12));
              int minColWidth = 120, maxColWidth = 200;
              for(int y = 0; y < tableA.getColumnCount(); y++)
                   TableColumn tbc = tableA.getColumnModel().getColumn(y);
                   tbc.setPreferredWidth(minColWidth);     
                   tbc.setMinWidth(minColWidth);
                   tbc.setMaxWidth(maxColWidth);
              scrollA = new JScrollPane(tableA);
              this.getContentPane().add(scrollA, BorderLayout.CENTER);
    Can someone tell me what I am missing?
    Thanks
    Augustine

    You need this
    tableA.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    otherwise it will always try and fit the table to the space available

  • No horizontal scroll bar on the Jtable. In order to see long column.....

    No horizontal scroll bar on the tJable.
    In order to see long cell data we have to eliminate other columns of the table.
    I need an horizontal scroll bar on the JTable if the data in a cell is longer.
    Could somebody help me out?
    Thanks in advance.

    in the jtable use following method :
    myTable.setAutoResizeMode(this.AUTO_RESIZE_OFF);
    KR,
    Jan

  • Horizontal scroll bar in FF4.0 not working

    The horizontal scroll bar takes the full width of the window and doesn't allow to scroll left or right.
    Occurs only in FF4, page displays fine in FF3.x, IE, Chrome.
    try http://bajkionline.com/krecik.html

    I have removed FF4 and reinstalled FF3.6.16 and the search bar works fine - like it always did.
    Shame I cannot use FF4.
    Would you please let me know when a solution to this problem can be found? BTW I do have Copernic Desktop Search installed. When I installed FF4 I did get a message that the Copernic add-in was not compatible. Could this be a problem?

  • Some web sites do not display a horizontal scroll bar but IE does

    For example: http://shop.ghirardelli.com/category-exec/category_id/35/nm/Sale/?utm_source=chocomail&utm_medium=pos1_save10-30DL&utm_campaign=20111124

    That site uses CCS code (overflow-x:hidden) to hide the horizontal scroll bar.<br />
    It is also missing in Google Chrome.

  • JTabel Horizontal scroll bar problem

    Hi,
    I want a horizontal scroll bar added to my table
    hence I do this
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    but the problem is If I increase the size of frame
    the cells do not resize hence there is a gap after
    the last column.
    How do I remove this gap

    Please reduce the container size in the screen thru SE51 that automatically create the scroll
    or check whether in the attributes of the screen "Hold scroll positio" not to be checked

  • Getting a horizontal scroll bar in the DHTML_SHUTTLE

    Hello,
    We are currently using Carl's DHTML_SHUTTLE procedure to display some shuttles.
    I have a problem where the data is longer than the width of the shuttle and was wondering if it is possible to implement a horizontal scroll bar so that the user can see it?
    Thanks,
    Paul

    alisadri wrote:
    Hi there,
    I have created a JScrollPane object for a JTable. Using the code below, I am trying to create a horizontal scroll pane for the JTable object but the horizontal
    bar doesn't move at all. this is the code. Also when I create the horizontal bar as "AS_NEEDED" the horizontal bar does not appear. The vertical bar works
    properly. Can someone help me with this please.
    This is the Code:
    loadTableScrollPane = new JScrollPane(getLoadTable()); //"getLoadTable()" return a JTable object.
    loadTableScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    loadTableScrollPane.setViewportView(getLoadTable());
    loadTableScrollPane.setBounds(new Rectangle(5, 149, 1135, 232));
    Just a wild guess ... because you do need to post a real example - but get rid of the setBounds and setPreferredSize and use pack() on the frame.

  • Help with code for inserting horizontal scroll bar in photo gallery in Business Catalyst site?

    Hi,
    I am using Business Catalyst and Dreamweaver to create a trial site.
    I am not sure if this is the correct forum to post this request but anyway I have inserted a photo gallery module at the bottom of the sidebar in the homepage of my test site.
    Can anyone advise on whether jquery or any other code can be inserted into the page or module code that will replace the "next" hyperlink below the first 4 photos with a horizontal scroll bar at bottom of the gallery so users can just scroll through all 12 images ?
    Kind Regards, Matt.
    http://craftime-bs6.businesscatalyst.com/

    Alyssa,
    Have you tried putting this rule back as it was originally:
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto; /*was 9px*/
        color: #EF9CCF;
        background-color: #FFF;
    That is, changing your 9px back to auto.
    And giving  us a link (as you did) is much better than printing out the code for us! Thanks!
    Beth

Maybe you are looking for