Horizontal scroll bar jumps

Hi
When you execute the following code , you will see a table , drag or extend the column size of column D such that , you get a horizontal scroll pane
Now when you click on first,second or third column ( i.e row selection ) no problem
but if u select the fourth column i.e D , then the horizontal scroller jumps to right
any clue where this is done , i dont want this effect , is there a way to disable it ?
Regards
kmm
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.table.*;
import java.awt.Component.*;
public class Table
public static void main(String[] args)
JFrame frame = new JFrame("Table");
frame.addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e)
Window win = e.getWindow();
win.setVisible(false);
win.dispose();
System.exit(0);
JTable table = new JTable( 6,4 )
public TableCellRenderer getCellRenderer(int row, int column) {
TableColumn tableColumn = getColumnModel().getColumn(column);
TableCellRenderer renderer = tableColumn.getCellRenderer();
if (renderer == null) {
Class c = getColumnClass(column);
if( c.equals(Object.class) )
Object o = getValueAt(row,column);
if( o != null )
c = getValueAt(row,column).getClass();
renderer = getDefaultRenderer(c);
return renderer;
public TableCellEditor getCellEditor(int row, int column) {
TableColumn tableColumn = getColumnModel().getColumn(column);
TableCellEditor editor = tableColumn.getCellEditor();
if (editor == null) {
Class c = getColumnClass(column);
if( c.equals(Object.class) )
Object o = getValueAt(row,column);
if( o != null )
c = getValueAt(row,column).getClass();
editor = getDefaultEditor(c);
return editor;
// Buttons
table.setValueAt( new JButton("Button"), 0, 0 );
table.setValueAt( new JButton("Button"), 0, 1 );
// Combobox
JComboBox combo = new JComboBox( new String[] {"First", "Second", "Third"} );
table.setValueAt( combo, 1, 1 );
// Labels
table.setValueAt( new JLabel("Label"), 1, 0 );
JLabel label = new JLabel( "Label", new ImageIcon( table.getClass().getResource("new.gif") ),
JLabel.LEFT);
table.setValueAt( label, 1, 2 );
// Scrollbar
//table.setValueAt( new JScrollBar(JScrollBar.HORIZONTAL), 2,1 );
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
// RadioButtons
JRadioButton b1 = new JRadioButton( "Group1 Button1" );
JRadioButton b2 = new JRadioButton( "Group1 Button2" );
JRadioButton b3 = new JRadioButton( "Group1 Button3" );
ButtonGroup g1 = new ButtonGroup();
g1.add( b1 );
g1.add( b2 );
g1.add( b3 );
table.setValueAt( b1, 3, 0 );
table.setValueAt( b2, 3, 1 );
table.setValueAt( b3, 3, 2 );
//checkbox
JCheckBox c1 = new JCheckBox( "Check box1 " );
JCheckBox c2 = new JCheckBox( "Check box2" );
JCheckBox c3 = new JCheckBox( "Check box3" );
table.setValueAt( c1, 4, 0 );
table.setValueAt( c2, 4, 1 );
table.setValueAt( c3,4, 2 );
table.setDefaultRenderer( JComponent.class, new JComponentCellRenderer() );
//table.setDefaultEditor( JComponent.class, new JComponentCellEditor() );
JScrollPane sp = new JScrollPane(table);
frame.getContentPane().add( sp );
frame.pack();
frame.show();
class JComponentCellRenderer implements TableCellRenderer
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
return (JComponent)value;
}

It is done by JTable in changeSelection(..) to turn it off:
table.setAutoscrolls(false);

Similar Messages

  • Stack Canvas Horizontal Scroll Bar

    Hi There,
    I'm using Forms 6i (Rel.2) and i am facing a problem with may stack canvas's horizontal scroll bar at runtime, as follows:
    As I put the cursor on an Item inside the stack canvas, and try to scroll away to the left where that Item is no longer viewable, and then stop scrolling, the scroll back will jump back to that Item,so I have to press and hold the mouse on the scroll bar as long as I need to see other Items at the far end! I tried to set the "Raise on entry" property to "YES", but no success.
    I tried the same in Forms 5 and it works fine with no problems at all!!!
    Any suggestions?

    Hi,
    My colleague found out that a timer I had programmed in a calling form to show the current time was actually refreshing every one second and in doing that it was refreshing the whole view which caused it to jump back to the first item. I had to remove the timer and it's working fine now.
    Thanks again,
    Ali

  • 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

  • How to get the Horizontal Scroll Bar for a Table?

    Hi All,
    As per my requirement, I am displaying several records in a Screen in a Tabular Format. But here I have to show 21 Columns in that table which is too high. I am able to display it but due to it I am getting a Horizontal scroll bar for the whole screen since all the columns are not getting displayed in the normal window screen space. But its looking too odd since once I am scrolling it to right the columns are getting displayed but the above Header Bar and Global buttons are not displaying, they are bound to the normal screen space.
    Is there a way to have a Horizontal scroll bar only for that table instead of the entire screen so that on scrolling that bar only the table rows will beshifted ant got displayed?
    With Thanks
    Kumar Gautam

    try this approach.
    include a raw text item before and table item.
    include the appropriate HTML tags in raw text item to enable horizontal scroll
    --Prasanna                                                                                                                                                                                                                                                                                                                                   

  • How do I view the Horizontal Scrolling bar and status bar at the bottom of the screen. I can only see the top menus, toolbars and vertical scroll bar?

    Before the most recent upgrade, the bottom horizontal scrolling bar and status bar appeared on my screen. Now since upgrading, I cannot see the. Anyone ideas how to restore them?

    If you haven't already, you could force-quit Quicktime by using the menu option from the desktop (finder) and choose Quicktime.
    Not sure what you have frozen on the screen, be it a failed movie, or some unusual screen shot. If you can find by date (created) you may be able to look for .mov or quicktime suffix name or other video file content to delete it.
    And you may have to restart your computer and perhaps run repair disk permissions from Disk Utility's first aid on the hard disk drive in your computer.
    Not sure if all that would help now, but it is something a few days late...!
    Good luck & happy computing!

  • Horizontal Scroll Bar

    I have this site that I'm practicing on called
    Massattack Studios,
    it's been a work in progress for a while experimenting with Flash
    and Dreamweaver 8.
    In internet explorer my scroll bar situation works fine, in
    Fire Fox the unwanted horizontal scroll bar appears. At least at
    the moment I'm not concerned with other browsers. Can anybody tell
    me how to get rid of that little guy?
    I'm looking at the Validator and it is very overwealming to
    me as a beginner with the code.
    Any help would be great, i can post anything you may need to
    figure it out, thank you very much!
    This is my main index page...
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <title>Massattack Studios</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    </head>
    <frameset cols="*,650,*" border="0">
    <frame src="left.htm" name="left" marginwidth="0"
    marginheight="0" scrolling=no>
    <frameset rows="100,*,25" border="0">
    <frame src="head.htm" name="head" marginwidth="0"
    marginheight="0" scrolling=no noresize>
    <frame src="home.htm" name="MainFrame" scrolling="yes"
    noresize="noresize" marginwidth="0" marginheight="0"
    id="MainFrame">
    <frame src="footer.htm" name="footer" marginwidth="0"
    marginheight="0" scrolling=no noresize>
    </frameset>
    <frame src="right.htm" name="right" marginwidth="0"
    marginheight="0" scrolling=no noresize>
    </frameset>
    <noframes><body>
    </body></noframes>
    </html>

    In the home.htm file that loads into your main frame, change
    the DOCTYPE.
    CHANGE:
    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
    TO THIS:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN">BTW:
    "Bumbing" has no effect in the NNTP forums where most of the
    answers come
    from and it's just annoying to the web form user who are
    patiently waiting
    for a response.

  • My horizontal scroll bar went missing when I maximise the window. How do I fix them?

    My horizontal scroll bar went missing when I maximise the window. How do I fix them? I tried everything; such as auto hide the task bar. Even with this, I still can't see the horizontal scroll bar. I even tried the following and I still can't see the horizontal scroll bar.
    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 dom and pause while the list is filtered
    (3) Double-click the dom.disable_window_open_feature.scrollbars preference to switch it from false to true. By choosing true, you disable sites from deciding whether there can be scrollbars on a window, and Firefox uses its standard behavior for the page.
    If you want to always get other bars, here are the corresponding settings:
    Menu Bar: dom.disable_window_open_feature.menubar
    Navigation Toolbar: dom.disable_window_open_feature.toolbar
    Bookmarks Toolbar: dom.disable_window_open_feature.personalbar
    Please help.

    Can you post a screen shot?
    Taking a Screen shot; '''''Windows > Start >''''' search box '''''> Snipping Tool'''''.
    Save the picture(s) to your desktop. Now look at the '''Reply''' box below.
    Do you see the button under it that says '''Browse'''? Click it and then select
    the screen shot(s) from the desktop.

  • How to make the knob of a horizontal Scroll Bar stay at right

    Hi I need some advise to achieve this:
    I have a chart continuously deploying towards the right side (think on an electro cardiogram that is continuously feeding data). All the chart information is kept available inside a JScrollPane. What I want to achieve is:
    1. if the horizontal scroll bar knob is at the right end of the scroll bar make the end part of the chart be displayed continuously (view is scrolling to the right, the knob stays at the right end)
    2. if the user moves the knob left from the right end freeze the motion and just show the selected portion (meanwhile data keeps being fed and stored but not displayed)
    3. when the user decides to drag the knob again to the right end the behavior of point # 1 resumes.
    The basic swing structure I'm using for this is the following:
    public class Electro extends JPanel {
    public Electro() {
    JFrame f = new JFrame();
    JScrollPane sp = new JScrollPane(this);
    f.getContentPane().add(sp);
         f.pack();
         f.setVisible(true);
    I would highly appreciate any feedback from fellow members. Thank you.

    hi friend
    try this in ur code
    public class Electro extends JPanel {
    public Electro() {
    JFrame f = new JFrame();
    JScrollPane sp = new JScrollPane(this);
    sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    f.getContentPane().add(sp);
    f.pack();
    f.setVisible(true);
    i think it will be help full to you
    thanks
    waiting for reply

  • 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.

  • Can horizontal scroll bar be removed?

    The listbox controls have horizontal scroll bar that can not be removed by property notes. Is there a way to change it to invisible? Also how do I change the controls from raised or recessed to flat? Thank you for your help.

    The only listbox with a horizontal scroll bar is the multicolumn listbox and it does have a property node to remove it or display it. In 8.5, the property is Visible Items>Horizontal Scrollbar Visible.
    There are modern controls, classic controls, and system controls on the palette. Pick the one you want or right click on an existing one and select 'Replace'. You can also right click and select Advanced>Customize.

  • 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

  • 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 problem with CL_GUI_ALV_GRID

    Hi Experts,
    I have created Dynamic ALV by using CL_GUI_ALV_GRID . Everthing is working fine if all the data is displaying in single screen. But if the number of columns increase with the output of data the horizontal scroll bar is not working.
    It is visible but when I click to scroll it to the end of screen it is not working. Can anybody help me that what can be the problem?

    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

  • Horizontal scroll bar problem in Portal????

    Hi Guys,
    I am facing some problem when i open any thread. Horizontal scrollong bar is coming at the end of the thread.
    eg: If i have some text in the thread which is more than width of the screen and has some 10 replies to that thread, Then i should be able to scrool at that position itself. But now i have to scroll down till end of all the replies and then i have to scroll the horizontal bar to right/left and scroll up to particular reply to see what is there.
    Is there any enhancement going on in portal or it is specific to my system? Please do let me know.
    Thanks,
    Vinod.

    I too am facing this problem with the horizontal scroll bar. 
    There are many other bugs, but I am reluctant to spend my time reporting them as last time I reported a problem here, I got a rude response.
    Al Lal

  • Horizontal Scroll bar in a web table

    Guys,
      is it possible to have horizontal scroll bar in webtable , not like the webtable propery for each column.
      just i want drag a scroll like blanket in webtable like in internet explorer.
      will assing full points for fix.
    Thanks
    Shan

    Hi Shan,
    The problem is not clear, but if you are talking about a table web item within Web Application Designer then there is a property for the number of columns to be displayed per page. Just set that property to an appropriate number. Remember while setting the property that it applies only to key figures and not characteristics. So if you set it to say 5 - it will display the horizontal scroll option if you have more than 5 key figures in your table.
    If you do not want the SAP default scroll bar then set this property to a sufficiently high number so that the table is not broken up - in this case you will get the default internet explorer based scroll bar since the table will not fit in a single screen.
    Hope it helps,
    Regards,
    Nikhil

Maybe you are looking for

  • Can't save as PDF from Firefox any more

    I can't convert pages to PDF any more. Not sure if this happened when I upgraded Firefox or when, but there is no menu option to convert to PDF. I use the Adobe CS3 suites and Firefox 3.5.9. == This happened == Every time Firefox opened == can't pinp

  • Problem in Service ticket

    HI all, Iam are working on CRM version 5.0, CIC webclient support package 07, we are creating a employee help desk scenario profile,for which have created a new profile by copying the standard "help desk" profile . while we creating a service ticket

  • SQL Query issue with large varchar column

    I have a SQL Query (PL/SQL function body returning SQL query) which contains a large varchar column. Even if I substring the column to 30chars when it displays on the page it wraps. I have tried putting nowrap="wrap" for the HTML table cell attribute

  • Simple text plain talk program - filterhappier - radiohead

    i was wondering if anyone knew if there was an online program where i could type in text and have the retro robotic voice read it out like on the old macs. i have a computer thus using windows so i doubt i can download the program though apple howeve

  • How can I keep the bookmarks toolbar open down the side?

    How can I keep the bookmarks toolbar open down the side?