Keep vertical scroll bar still y JScrollPane

Hello all!
I have got a JTable added into a JScrollPane, which scroll bars are always shown.
I have to repaint the JTable each 3 seconds and I would like to keep the vertical scroll bar in its original position, for example if I am watching row 24 of the JTable when the JTable is repainted I would like the vertical scroll bar to be in the same position as it was before repainting because now the vertical scroll bar is repainted always at the top...
With the horizontal bar it works, the bar does not move from its previous state when the JTable is repainted...
Any idea of what is happening?
Thanks in advance :)

This would do for u! ... do it after you have updated the table with the new rows... if you are not using the default table model then you can still get the row count through your JTable object ...
This part moves the scrollbar to the last row coz im doing "myDefaultTableModel.getRowCount()-1", you can keep the current row index in an instance level variable bjust before refreshing the table and use it in this.setRowSelectionInterval() method ...
this.setRowSelectionInterval(myDefaultTableModel.getRowCount()-1, myDefaultTableModel.getRowCount()-1);
this.setColumnSelectionInterval(1, 1); //didnt need any specific column coz I wanted the row basically..
this.scrollRectToVisible(this.getCellRect(this.getSelectedRow(), 1, true));This basically selects the given row and then moved the scrollbar over to that point as well ...
OR, here's another alternative!! you can also get the current scrollbar value similarly jsut before refreshing and pass that on to this method ...
this.jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getValue());Hope it helps...
Cheers!
Asim

Similar Messages

  • Question on vertical scroll bars in JScroll Pane

    Hi,
    I managed to display my chat program with a vertical scroll bars by using JScrollPane. Every time some on types a line, this is appended to whatever was previously in the JTextArea (the JScrollPane has a JTextArea in it). Even though this works fine, when the dimension of the JTextArea is full with text, one has to scroll down to see what was the last line of text that was typed.
    Is there a way to make the verticall scroll area alwas scrolled down (I mean, scrolled to the bottom so I can see new incoming text without manually having to scroll it down?)
    Thanks!
    Cecilia.

    You might try adding a properties listener to the JTextArea listening for a "resize/size" property change and when it does, force the scroll bar to go to max.

  • Vertical Scroll Bars not wanted

    I have read other messages, but I cannot figure out why the
    vertical scroll bar still appears in IE even though there is no
    content below. The bar is there but not useable. Is there some code
    that will turn this off when not needed?

    That's the way IE (and some other browsers) works. It always
    draws a
    vertical scrollbar. If the scrollbar is not needed, it is
    "ghosted" and
    not usable, as you have noticed. When the page's content
    exceeds the
    window height the ghosted scrollbar rises from the grave and
    becomes alive.
    Other browsers do not add a scrollbar until one is needed.
    Some people
    don't like this because the addition of the scrollbar removes
    some space
    from the window, making it a bit narrower, and page elements
    that are in
    some way positioned or sized in relation to the window's
    width will
    shift and/or change size slightly.
    IE's solution prevents this content shifting at the expense
    of devoting
    part of the window to a non-functioning interface element
    some of the time.
    (It is my belief that either method of handling the vertical
    scrollbar
    is fine, and skilled designers will not create pages that
    fall apart if
    a scrollbar should appear where there was none before. For
    the record, I
    subscribe to the no-scrollbar-at-all-until-one-is-needed
    doctrine.)
    James M. Shook
    http://www.jshook.com

  • JScrollPane - change vertical scroll-bar

    I am developing an application to be run on a touch-screen monitor. The customer has asked that I make the vertical scroll-bar on the tables easier to use. How do I set the width of the scroll-bar(s) in a JScrollPane?

    Do you want to set the width of all vertical scroll bars (and in that case, probably also the height of all horizontal scroll bars too) OR the width of one specific scroll bar of one specific scroll pane?
    db

  • SharePoint 2010, unable to see the site vertical scroll bar in Safari and Mozilla Firefox

    Hi,
    I am not able to see the sharepoint site vertical scroll bar in Safari and Mozilla firefox in window OS as well as  Mac OS , even I have tried with various option of the browser but still not able to see the vertical scroll bar.
    I have tried to check with other sharepoint site in Windows OS and found that I can see others sites vertical scroll bar in Safari and Mozilla firefox , Please let me know why I am not able to see for my sharepoint sites.
    Thanks
    Roopak

    Screen in jammed or how it looks without vertical scroll bar ? Check with site master page if you have modified anything related to  vertical bar or else Try in other system and check if you are able to see vertical bar . 
    Let us know your result 
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Text editing window expands instead of creating vertical scroll bar

    In the last few days, I have noticed that when I try to edit or post to Wordpress.com the vertical scroll bar no longer appears on the text editing box. Instead the box just gets progressively larger which makes it very difficult to get to other items on the WordPress editing screen, such as tags and categories. This problem seems to have arisen during the v31.0 auto-upgrade. Is anybody else having this issue and what steps can I take to solve it? (FYI, I tried modifying the setting described in another response about a similar issue using the about:config screen, with no success.)

    I don't know whether your dashboard has the "Visual" and "Text" buttons, but I believe the Visual uses CKEditor or another WYSIWYG editor and the Text editor might be a simpler design. Are both affected?
    I searched around to see whether I could find Wordpress.com support threads or other stories about it and I can't. So I'll fall back on some general suggestions:
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    Alternately, you also can clear Firefox's cache completely using:
    "3-bar" menu button (or Tools menu) > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    If you have a large hard drive, this might take a few minutes.
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site:
    * right-click and choose View Page Info > Security > "View Cookies"
    * (menu bar) Tools menu) > Page Info > Security > "View Cookies"
    In the dialog that opens, you can remove WordPress.com cookies without affecting other sites.
    Then try reloading the page. Does that help?
    To rule out extensions as a possible culprit, could you try the site in Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions, some advanced features, and some custom settings. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * (menu bar) Help menu > Restart with Add-ons Disabled
    Note: Flash and other plugins still run
    After Firefox closes, a small dialog should appear: click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • Vertical Scroll Bar on the device display

    Hello,
    I had the problem with both horizontal and vertical scroll bars. Managed to get rid of the horizontal scroll bas using the parameters ~itsmobileelemfactor and ~itsmobileelemunits but the vertical scroll bar is still there. As our transactions are developed internally, I managed to sqeeze the screen elements but still the vertical scroll bars are there.
    I am testing with Intermec CK3 device with Intermec Browser.
    I was going thru this forum and someone has suggested to modify the CSS.
    Can someone help me which html parameters are required and under which css class e.g. font size, line-height etc to reduce the overall screen size? I am not good in HTML.
    Thanks in advance.
    Regards
    Narottam

    Hi Oisin,
    Parameters in SE80:
    ~GENERATEDYNPRO = 1
    ~ITSMOBILE = 1
    ~SOURCES = ZZITS_IB_LM00,ITSMOBILE01,ITSMOBILE
    ~THEME = 99
    ~TRANSACTION = LM01
    Parameters in SICF:
    ~ITSMOBILE = 1
    ~TRANSACTION = LM01
    ~THEME = 99
    ~SOURCES = ZZITS_IB_LM00, ITSMOBILE01,ITSMOBILE
    ~POPUPS = 1
    ~WEBTRANSACTIONTYPE = EWT
    ~ITSMOBILEDEVICEINCLUDE = ZZ_IBROWSE
    ~ITSMOBILEELEMFACTOR = 8
    ~ITSMOBILEELEMUNIT = px
    I know you helped me earlier and provided two OSS notes. Those nores are installed.
    Again, please let me know what I am missing to get rid of the vertical scroll bar. Strictly we have followed 16X20 screen size which is SAP RF standard.
    Regards
    Narottam

  • Help with a vertical scroll bar issue with a List component

    hi. i have a basic <s:list> that uses an XMLListCollection as it's data provider and a very basic itemrenderer. when a row in the list is clicked a function gets the list.selectedIndex then populates some text fields with more xml data. that all works fine.. the problem i have is that the vertical scroll bar on the list seems to be "clickable" - just like a row in the list. the scroll bar scrolls normally but when it's clicked the selectedIndex becomes -1 which is not helpful b/c the value -1 is passed to the XMLListCollection.
    any ideas? cheers.

    thanks but still problematic...surely the <s:List> component shouldn't return a value when the scrollbar thumb is clicked? i created a very basic list (see below) and made the list dimensions short enough so that there is a vertical scrollbar and found that when the scrollbar thumb is clicked the trace(event.currentTarget.selectedIndex) returns a number. that's annoying b/c i just want a selectedIndex value for a row that is clicked not the scrollbar.
    any ideas to get around? cheers
    <fx:Script>
    <![CDATA[
    protected function list1_clickHandler(event:MouseEvent):void
    trace(event.currentTarget.selectedIndex);
    ]]>
    </fx:Script>
    <s:List x="162" click="list1_clickHandler(event)" y="276" labelField="@label" width="144" height="153">
    <s:dataProvider>
    <s:XMLListCollection>
    <fx:XMLList xmlns="">
    <node label="one"/>
    <node label="two"/>
    <node label="three"/>
    <node label="four"/>
    <node label="five"/>
    <node label="six"/>
    <node label="seven"/>
    <node label="eight"/>
    <node label="nine"/>
    <node label="ten"/>
    <node label="eleven"/>
    </fx:XMLList>
    </s:XMLListCollection>
    </s:dataProvider>
    </s:List>

  • Textarea: strange vertical scroll bar

    Hi, everyone
    I implemented textarea with JTextPane, code is below.
    The problem is that,
    when there is only one pane in the content of HBox, the vertical scroll bar runs normal;
    but when there is 2 panes, the vertical scroll bar changes between visible and invisible again and again.
    My code wrong? or a bug of JavaFX?
    Thanks.
    * TextArea.fx
    * Created on 2009-12-5, 22:27:47
    package morsshow;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import java.awt.Dimension;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javafx.ext.swing.SwingComponent;
    import javafx.scene.layout.HBox;
    * @author icycandy
    var text: JTextPane = new JTextPane();
    var pane: JScrollPane = new JScrollPane(text,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    text.setText("youyouyouyouyouyouyouyouyouyouyou");
    text.setPreferredSize(new Dimension(500, 300));
    var text1: JTextPane = new JTextPane();
    var pane1: JScrollPane = new JScrollPane(text1,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    text1.setText("lovelovelovelovelovelovelovelovelovelove");
    text1.setPreferredSize(new Dimension(500, 300));
    Stage {
        title: "love you"
        scene: Scene {
            content: [
                HBox{
                    content:[
                        SwingComponent.wrap(pane),
                        //SwingComponent.wrap(pane1)
    }

    Hi,
    I've just used the following SQL statement to create a tabular form:
    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "PHONE1",
    APEX_ITEM.TEXTAREA(5, PHONE2, 5, 50, 'style="overflow-Y:scroll"') "PHONE2"
    from "#OWNER#"."EMP"PHONE2 is a small field, so you probably won't be able to save anything, but this statement is used in: http://htmldb.oracle.com/pls/otn/f?p=33642:100
    Both in IE7 and FF3, the scroll area appeared on the right of the box.
    Andy

  • Force vertical scroll bar

    Hi all,
    I would like to force a vertical scroll bar on all of my pages to keep the page from appearing to shift on some pages (pages long enough for scoll bars vs pages not long enough to need scroll bar). On my site I notice it in IE8 and FF3.
    I know this has been discussed before but I am not able to find it.
    Here is my code currently in my style.css concerning HTML and body elements
    html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    html {
    font-family: Arial, Helvetica, sans-serif;
    font-size:  76%;
    height: 100%;
    body {
    color: #000;
    margin: 0 0 0 0; /* Sets the margin properties for an element using shorthand notation (top, right, bottom, left) */
    padding: 0 0 0 0; /* Sets the padding properties for an element using shorthand notation (top, right, bottom, left) */
    text-align: center; /* Centers the page content container in IE 5 browsers. */
    background: #2D4262;
      How would  I accomplish this?
    Thanks
    Chris

    Thanks for responding,
    I tried both ways..I do not know CSS very well so I probably did it incorrectly.. Heres what happens when I tried both ways.
    My background goes away if I add Michaels suggestion:
    To see if I did it correctly here is what I had
    html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    html {
    font-family: Arial, Helvetica, sans-serif;
    font-size:  76%;
    margin-bottom:.01px;
    min-height:100.2%;
    And if I tried to add Murrays suggestion, nothing happened
    To see if I did it correctly, here is what I had
    html, :root { overflow-y:scroll; }
    html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;}
    html {
    font-family: Arial, Helvetica, sans-serif;
    font-size:  76%;
    height: 100%;
    Again, I am probably not doing it correctly....
    Thanks
    Chris

  • Vertical scroll bar disappears on the timeline?

    After I use the vertical scroll bar once it disappears and I am unable to scroll. If I click the film strip on and off, it comes back. Is there a way to always keep the scroll bar visable on the timeline?

    That has got to be a bug. Go to the Motion menu and Provide Motion Feedback... !
    Otherwise, you can scroll with your mouse. I use a mouse with a scroll wheel, but I think I remember the magic mouse has a scroll gesture(?).
    You can make the layers smaller by mousing over one of the lines in the layers list to the left of the timeline. The cursor should change to a double-pointed arrow. Click and drag the layers smaller.
    You can open the timeline window wider by mousing over the Timeline top border, and click drag to make it larger.
    I use this feature so rarely that I had never noticed before. When the scroll bar does appear, it's not "fully formed" either -- just a grey bar -- no resize controls on the ends at all.

  • How to get rid of vertical scroll bar in ABAP webdynpro table

    Hello,
    I have created a dynamic WD table using cl_wd_dynamic_tool=>create_table_from_node and then I restricted the number of lines to 1 by setting the 'Set_Row_Count' and 'Set_Visible_Row_Count' = 1. But still when I run the application I see a vertical scroll bar which looks very awkward for only 1 line. How do I get rid of this vertical scroll bar ?
    Thanks and Regards,
    Sandhya

    Hi,
    Is your table under any transparent container. have you set any scroll mode for this.
    One more thing, have you used SER SCROLLABLE COL COUNT property.Also is this property set firstVisibleScrollableCol.
    Regards,
    Lekha.
    Edited by: Lekha on Oct 28, 2009 11:18 AM

  • Editing a Vertical Scroll Bar

    Can you edit the color of a vertical scroll bar when creating a data list?  All I've been
    able to get is that default sky blue color.

    Yes, you can edit the complete look and feel of your scrollbar.  Select the scroll bar an keep double clicking until you drill down into the artwork for the different layers.

  • Missing Vertical Scroll Bar on Firefox browser

    I have lost my vertical scroll bar on Firefox after installing Minefield. I have tried uninstalling both programs and reinstalling Firefox but the scroll bar is still missing. Firefox is running the default Theme. The scroll bar comes back when Firefox is running in Safe Mode. Can anyone help?

    I have a Mac with Firefox 5.0.1. I had the same problem with the vertical scrollbar. After reading your post I began disabling my most recent add-ons. Findbar Tweak 0.5.2 was the problem. Thanks for the help!

  • Vertical scroll bar in a tree node

    Hi Friends,
    I am trying to create a tree in Apex 4.0. I need a vertical scroll bar in my tree nodes if the no: of values is greater than 8. For example i am having a tree with customers and sites. When i press the customers it will list the sites under that customer. I need a vertical scroll bar to be displayed for sites if the no: of sites is greater than 8, so that i can limit the size of the tree. Is there any ways to achieve this in Apex 4.0. Any input for this will be appreciated.
    Thanks,
    Nav

    Hi,
    My test page was upgraded to version 4 along with the rest of the OTN workspaces. I still have access to the tree template but can not guarantee how long that will last as I have no idea behind the reasoning for removing access to new tree's templates. You can access existing old trees by changing the app:page in the URL to 4000:28 - but, note, that new Apex 4 trees are not included on this page as they are generated by widgets not by templates.
    For my old tree, to add the scrolling around the entire tree, I edited the tree's template - by clicking on the Tree link in the region - and added the following at the top of the "Before Tree" setting:
    &lt;div style="height:200px; width:300px; overflow-y:auto;"&gt;and add the following to the bottom of the "After Tree" setting:
    &lt;/div&gt;I have not, as yet, been able to find a way of adding scrollbars within a list when there are more than x number of entries.
    Andy

Maybe you are looking for

  • MS Project 2013 has stopped working APPCRASH in 64 bit Windows 7 OS

    Dear All, last 3 days i am facing problem regarding Project Professional 2013 sync with SharePoint 2013 , When i click the ´Open with Project´ in SharePoint task list,it opens the Project Professional and stopped the Project.(ref below screen shot) E

  • Time comparison in database

    I'm developing a attendance record for my company and I have the following issues. The table looks like this. Table name: Attendance, Structure is like this, staffID      int(11)       date      date time_in time time_out time Date      Time In Time

  • Crystal Reports (Web Viewer) Configuration Problem

    Hi, I am trying to show a simple report via JSP. But it gives an error that I could not understand. I think it is related with configuration files. Any recommendations would be helpful! The error's print stack trace and my configuration file's conten

  • E900 download speed limit

    Hi, guys! I have an E900 router and my internet speed is 100 mbps, but I only download with about 5 MB/s. Could anyone help me solve this issue? Thank you.

  • Read from 16 GB Micro SD is Extremely Slow

    I have had a new Blackberry Tour 9630 equipped with v4.7.1.40 software and a 16 GB micro SD card.  Reading files from the card is extremely slow.  I first noticed this with video playback (extremely jerky and freezes) and actually replaced my first 9