Disabling of Horizantal scroll bar in a JTable

Hi,
I have a JTable.I disabled the whole table by using
JTableObj.setEnabled(false); But here the horizantal scrollbar is
still enabled means I can drag the scroollbar.
I used like JScrollpaneObj.gethorizantalscrollbar().setEnabled(false)....but still it is not working..
How can I make my horizatal scrollbar disable.
Regards,

I used like JScrollpaneObj.gethorizantalscrollbar().setEnabled(false)....but still it is not working..Works fine for me.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • 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

  • Is there any way to disable the expanding scroll bars in Mountain Lion?

    Since I never scroll by dragging the scroll bars with the cursor, I find the expansion of the scroll bars to be a distracting and even productivity limiting feature. Is there any way to disable the expansion of the scroll bars (perhaps with a terminal command)? System Preferences doesn't have an option to switch this feature off as far as I'm concerned.
    Thanks a lot in advance.

    No!

  • Disable / hide ALV scroll bar (Navigation Pane)

    Hello,
    is there a way to disable or hide the scroll bar in an ALV table? in other words I wanna display all
    the data in an ALV table without having to scroll down.
    Thanks,
    Abdul.

    Hi, you can use the table configuration to control this. set_visible_row_count to -1.
    data:
    l_salv_wd_table type ref to iwci_salv_wd_table,
    l_table type ref to cl_salv_wd_config_table.
    l_salv_wd_table = wd_this->wd_cpifc_usage_alv( ).
      l_table = l_salv_wd_table->get_model( ).
      l_table->if_salv_wd_table_settings~set_visible_row_count( -1 ).

  • Horizontal scroll bar is in JTable

    I am doing following code to set horizontal and vertical scroll bar to Table. vertical is working nicely but horizontal is not added to table and all colum of table got shrink and hardly visible. so i want to set horizontal scrollbar as needed.
    how can that possible. looking for response
    mTable.setPreferredScrollableViewportSize(new Dimension(TABLE_WIDTH, TABLE_HEIGHT));
    mTable.setRowHeight(TABLE_ROW, TABLE_ROWHEIGHT);
    mTable.getTableHeader().setResizingAllowed(false);
    mTable.setGridColor(Color.darkGray);
    mTable.getTableHeader().setReorderingAllowed(false);
    mScrollPane = new JScrollPane(mTable);
    mScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    mScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    Message was edited by:
    Prashant_SDN

    that looks odd. what is wrong in this case
    Nothing's wrong. The columns all start up with the same default width.
    If you want it fitted to width on being shown and then become adjustable then you should invoke that change in a listener which executes when the component is shown (the reliable way to do this is use a HierarchyListener which checks isShowing() and then executes if that's true, then deregisters itself).

  • Scroll bar in a JTable

    Hello,
    can anyone tell me as to how i can set the scrollbar position to the top after i populate a JTable ?

    It'll be something like
    scrollPane.getVerticalScrollBar().setValue(0);However, depending on how you're populating your table, you may have to invoke this after the current operation has completed 'cos with some components the refresh from the model causes it to scroll to the bottom again. If this happens then try using SwingUtilities.invokeLater.
    Hope this helps.

  • How to get rid of scroll bars in sub panels when displaying a VI which is part of a class?

    I am writing an application that applies different analyses to a set of data. The program must be flexible configurable. To not clutter the GUI with too much elements I ended up with the idea to load the needed user interfaces for each specific analysis dynamically into a single sub panel when needed. This works well without any problem.
    Due to the fact that all analyses share some common functionality I have decided to use LabVIEW classes for implementation. Each class has one VI representing the user interface to show in the sub panel.
    This works also well BUT the sub panel always shows a horizontal and vertical scroll bar I don't want to see!
    I have already learned that I need to change the user interface VI to a custom "Window Appearance" and disable the "Show scroll bar" properties. But this seems to work only for "normal" VIs but not for VIs that are part of a class.
    Any ideas?
    Ingo
    Solved!
    Go to Solution.

    Thanks Pixar, this was the right tip!
    Although: there seems to be a difference between "normal" VIs and VIs that are members of a class.
    For "normal" VIs it is sufficient to set the property to "Off While Running" and it works as expected.
    VIs part of a class need the "Always Off" setting" which is only accessible via right click on the scroll bars but not via the VI's properties box.
    Thanks and Regards
    Ingo

  • Scroll bar on embedded blog on events page & rolls over header

    I've just entered the embedded html code for the events page in the tutorial (part 4) & now have a vertical & horizantal scroll bar showing + the blog rolls over the header rather than under it.  How can I fix this?  I've just downloaded the latest update for Muse & think the recent changes in master positioning may have changed?

    I found a fix, although I'm not sure it is the best way. In Muse CC it looks like layers have replaced the ability to arrange certain items on top of other items (the move to feature). When I added the HTML code, it comes in as it's own layer, but still seems to be within the default layer for that page. So what I did was create a new layer in the layers panel, then I dragged the HTML code layer to be inside of that layer instead. Then I made sure that my new layer was under the layer holding the header and everything else. Seems to do the trick.

  • Scroll Bar on Dashboard

    Hi Gurus,
    We have two or three requests on one page of dashboard .Is it possible to horizantal scroll bar on each request
    Because when i use scroll bar at page two requests are scrolling down
    Can this possible please suggest me how this can be done
    Thanks in Advance

    Hi
    I tried that one but i want scroll bar on each requests that two requests are in two sections on page
    Because when i scroll down i am getting two requests but i want to see only one request by scrolling down
    Please help me how this can be done
    Thanks in Advance

  • SCROLL BAR OF WINDOW DOES NOT APPEAR IN THE WEB

    Hi OTN Memebers,
    My problem is in one of my form the canvas type is content. It's
    size is bigger than that of windows size. When i run the form in
    the client/server enviroment, the window scroolbars are
    displayed. But when i try to deploy the from on the web , the
    window scroll bars are not displayed.
    Any solution for this. Please help me out.
    Feroz.
    null

    Feroz A. Khan (guest) wrote:
    : Hi OTN Memebers,
    : My problem is in one of my form the canvas type is content.
    It's
    : size is bigger than that of windows size. When i run the form
    in
    : the client/server enviroment, the window scroolbars are
    : displayed. But when i try to deploy the from on the web , the
    : window scroll bars are not displayed.
    : Any solution for this. Please help me out.
    : Feroz.
    This is a VERY OLD known problem with the product. The solution
    is to put your content canvas on a stacked canvas and give the
    stacked canvas scroll bars. Then disable the windows scroll
    bars, otherwise you'll end up with 2 sets in Client/Server
    mode...
    Mark
    null

  • JTable can't display column names and scroll bar in JDialog !!

    Dear All ,
    My flow of program is JFrame call JDialog.
    dialogCopy = new dialogCopyBay(frame, "Bay Name Define", true, Integer.parseInt(txtSourceBay.getText()) ,proVsl ,300 ,300);
    dialogCopy.setBounds(0, 0, 300, 300);
    dialogCopy.setVisible(true);        Then,I set the datasource of JTable is from a TableModel.
    It's wild that JTable can diplay the data without column names and scroll bar.
    I have no idea what's going wrong.Cause I follow the Sun Tutorial to code.
    Here with the code of my JDialog.
    Thanks & Best Regards
    package com.whl.panel;
    import com.whl.vslEditor.vslDefine;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Frame;
    import javax.swing.JDialog;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    public class dialogCopyBay extends JDialog {
        vslDefine glbVslDefine;
        int lvCnt = -1;
        JTable tableCopyBay;
        int bgnX = 0;
        int bgnY = 30;
        int tableWidth = 100;
        int tableHeight = 100;
        public dialogCopyBay(Frame frame, String title, boolean modal, int sourceBay,
                vslDefine pVslDefine, int ttlWidth, int ttlHeight) {
            super(frame, title, true);
            Container contentPane = getContentPane();
            System.out.println("dialogCopyBay Constructor");
            glbVslDefine = null;
            glbVslDefine = pVslDefine;
            copyBayModel copyBay = new copyBayModel((glbVslDefine.getVslBayStructure().length - 1),sourceBay);
            tableCopyBay = new JTable(copyBay);
            tableCopyBay.setPreferredScrollableViewportSize(new Dimension(tableWidth, tableHeight));
            JScrollPane scrollPane = new JScrollPane(tableCopyBay);
            scrollPane.setViewportView(tableCopyBay) ;
            tableCopyBay.setFillsViewportHeight(true);
            tableCopyBay.setBounds(bgnX, bgnY, tableWidth, tableHeight);
            tableCopyBay.setBounds(10, 10, 100, 200) ;
            contentPane.setLayout(null);
            contentPane.add(scrollPane);
            contentPane.add(tableCopyBay);
        class copyBayModel extends AbstractTableModel {
            String[] columnNames;
            Object[][] dataTarget;
            public copyBayModel(int rowNum ,int pSourceBay) {
                columnNames = new String[]{"Choose", "Bay Name"};
                dataTarget = new Object[rowNum][2];
                for (int i = 0; i <= glbVslDefine.getVslBayStructure().length - 1; i++) {
                    if (pSourceBay != glbVslDefine.getVslBayStructure().getBayName() &&
    glbVslDefine.getVslBayStructure()[i].getIsSuperStructure() == 'N') {
    lvCnt = lvCnt + 1;
    dataTarget[lvCnt][0] = false;
    dataTarget[lvCnt][1] = glbVslDefine.getVslBayStructure()[i].getBayName();
    System.out.println("lvCnt=" + lvCnt + ",BayName=" + glbVslDefine.getVslBayStructure()[i].getBayName());
    public int getRowCount() {
    return dataTarget.length;
    public int getColumnCount() {
    return columnNames.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int rowIndex, int columnIndex) {
    return dataTarget[rowIndex][columnIndex];
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    public boolean isCellEditable(int row, int col) {
    if (col == 1) {
    // Bay Name Not Allow To modify
    return false;
    } else {
    return true;
    public void setValueAt(Object value, int row, int col) {
    dataTarget[row][col] = value;
    fireTableCellUpdated(row, col);

    Dear DB ,
    I am not sure what you mean.
    Currently,I don't undestand which code is error.
    And I also saw some example is add JTable and JScrollPane in JDialog.
    Like Below examle in Sun tutorial
    public class ListDialog extends JDialog implements MouseListener, MouseMotionListener{
        private static ListDialog dialog;
        private static String value = "";
        private JList list;
        public static void initialize(Component comp,
                String[] possibleValues,
                String title,
                String labelText) {
            Frame frame = JOptionPane.getFrameForComponent(comp);
            dialog = new ListDialog(frame, possibleValues,
                    title, labelText);
         * Show the initialized dialog. The first argument should
         * be null if you want the dialog to come up in the center
         * of the screen. Otherwise, the argument should be the
         * component on top of which the dialog should appear.
        public static String showDialog(Component comp, String initialValue) {
            if (dialog != null) {
                dialog.setValue(initialValue);
                dialog.setLocationRelativeTo(comp);
                dialog.setVisible(true);
            } else {
                System.err.println("ListDialog requires you to call initialize " + "before calling showDialog.");
            return value;
        private void setValue(String newValue) {
            value = newValue;
            list.setSelectedValue(value, true);
        private ListDialog(Frame frame, Object[] data, String title,
                String labelText) {
            super(frame, title, true);
    //buttons
            JButton cancelButton = new JButton("Cancel");
            final JButton setButton = new JButton("Set");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ListDialog.dialog.setVisible(false);
            setButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ListDialog.value = (String) (list.getSelectedValue());
                    ListDialog.dialog.setVisible(false);
            getRootPane().setDefaultButton(setButton);
    //main part of the dialog
            list = new JList(data);
            list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            list.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        setButton.doClick();
            JScrollPane listScroller = new JScrollPane(list);
            listScroller.setPreferredSize(new Dimension(250, 80));
    //XXX: Must do the following, too, or else the scroller thinks
    //XXX: it's taller than it is:
            listScroller.setMinimumSize(new Dimension(250, 80));
            listScroller.setAlignmentX(LEFT_ALIGNMENT);
    //Create a container so that we can add a title around
    //the scroll pane. Can't add a title directly to the
    //scroll pane because its background would be white.
    //Lay out the label and scroll pane from top to button.
            JPanel listPane = new JPanel();
            listPane.setLayout(new BoxLayout(listPane, BoxLayout.Y_AXIS));
            JLabel label = new JLabel(labelText);
            label.setLabelFor(list);
            listPane.add(label);
            listPane.add(Box.createRigidArea(new Dimension(0, 5)));
            listPane.add(listScroller);
            listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    //Lay out the buttons from left to right.
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
            buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
            buttonPane.add(Box.createHorizontalGlue());
            buttonPane.add(cancelButton);
            buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
            buttonPane.add(setButton);
    //Put everything together, using the content pane's BorderLayout.
            Container contentPane = getContentPane();
            contentPane.add(listPane, BorderLayout.CENTER);
            contentPane.add(buttonPane, BorderLayout.SOUTH);
            pack();
        public void mouseClicked(MouseEvent e) {
            System.out.println("Mouse Click");
        public void mousePressed(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseReleased(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseEntered(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseExited(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseDragged(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseMoved(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
         * This is here so that you can view ListDialog even if you
         * haven't written the code to include it in a program.
    }

  • Disable horizontal scroll bars from TOC

    Hi All,
    I am a silent member on this form. PLease help me with this
    issue. I want to disable horizontal scroll bar in the TOC pane in
    Webhelp. In Flash Help for some reason, it doesnt appear at all. So
    please can u guys help me out .... It really urgent .....

    Hi,
    Try this.
    In RoboHelp 6:
    Click on the Project pane on the left-hand pane.
    Open the Window that you are using for your project.
    Click the Advanced Properties button.
    Click on the Styles tab and you will see a Horizontal Scroll
    option.
    Good luck,
    Debbie Sarig
    www.lingotip.com - Translating the World!

  • Disable array indicator but enable scroll bar ?

    Dear All,
    is there a way to disable an array without disabling the ability to scroll down with the mouse (scroll bar is also disabled if you choose disable in properties). The array indicator is clickable althoug not writable but causes confusion for the user...as if you can write something.
    thank you .

    Hi mbhatti2000,
    - Could you put up a small example of what you mean?
    If you just want to disable the array indicator and gray it out, then you can use the property shown below.
    Regards,
    Peter D
    Attachments:
    DisableIndicator.vi ‏9 KB

  • iframe tag + disable horizontal scroll-bar

    Hi..
    I want to disable horizontal scroll-bar only.The code is::
    <iframe>
    style="overflow-x:hidden;overflow-y:visible"
    </iframe>
    It's working in IE but not in mozilla firefox.
    Can anyone plz help.
    regards
    Sonia

    Funny, I tried it out; it's working in Firefox but NOT in IE 7.
    Check these out and do a little tweaking I guess....
    http://www.brunildo.org/test/Overflowxy2.html
    http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe
    Not a Java question though...

  • JTable column movement and scroll bar

    Hello:
    I have a JTable with about 30-40 columns. Sometimes I would like to drag the column from rightmost to closer to the left end. I am not able to do that in one shot. and instead have to do it in multiple steps. Is there a way for the scroll bar to sort of move alongside the column as I drag it along?

    i dont know if there is way off hand. But you can put your own mouseListener of the JScrollPane and i am sure there is some method to check if you are dragging the JTable and if you are move the JScrollBar in the direction.
    I think that you are going to have to make you own implementation of this.
    David

Maybe you are looking for

  • Cannot restore my iPod touch 3g "Software for this iPhone is not currently"

    Hello, II have a big problem, I cannot restore my iPod touch. I cannot get anything to show on the screen, it seems stuck in DFU mode. When I connect it to my pc, iTunes show this message "iTunes has detected an iPhone in recovery mode. You must rest

  • We have a new Wordpress site, how do I add a description and artwork to the RSS feed of the podcast?

    Hello: I am surprised I could not find this on a search of Google or Apple Support.  Our church has a new website created with Wordpress.  We have all of the functionality ready to go in order to have the RSS feed work with the itunes store. However,

  • Mail update not working correctly

    Hi- In the last week, my macs have stopped updating (on mobileme) correctly. I can see new mail on all macs but only the iphone correctly updates any delete I make. If I view the mail on one mac and move some and delete some, when I open the second m

  • Can we handle various other kind of transactions in JMS transaction?

    I know we can handle heterogenous transactions like JDBC Transactions, JMS transactions, etc from JTA. Can we similarly handle such various txns in JMS transactions also? SO say when I get a message, I need to send another message, and update some 2-

  • Sales Returms - unique requirement

    Dear Friends, The following is my unique requirement to process Sales returns. For sales returns i am using order type RE and movement type 655, 653 and 651. By using this movement types and order types PGR (Post goods receipt) will happen, stocks ar