Results 1 to 3 of 3
- 07-02-2010, 08:28 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Automatic scrolling of JScrollPane
here is the problem..
I creat a JList and add it to a JScrollPane.I set its vertical scroll bar policy to Always Visible. Then I add it to the CENTER of content pane of a JFrame.
Now i want to add new members to the list dynamically. the problem is when the list grows beyond the vertical size of the JFrame, the scroll pane does not automatically scroll down to display the newly added items. I have to manually scroll down to see the new members.
My question is what should I do to make the scroll bar automatically scroll down, so that I can see the most recent additions to the list.
Thanks in advance..:)
- 07-02-2010, 09:22 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,146
- Rep Power
- 5
After you add the item you invoke:
Java Code:list.ensureIndexIsVisible(...);
- 07-03-2010, 05:51 AM #3
Member
- Join Date
- Jul 2010
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Automatic sign in?
By dunafrothint in forum NetworkingReplies: 1Last Post: 03-26-2010, 03:00 PM -
automatic email
By pracheebapate in forum New To JavaReplies: 2Last Post: 01-18-2009, 08:07 PM -
automatic email
By aswin in forum New To JavaReplies: 0Last Post: 11-13-2008, 08:03 AM -
Getting JScrollPane to stop auto-scrolling
By Shadow in forum AWT / SwingReplies: 8Last Post: 10-21-2008, 08:52 PM -
JScrollPane not scrolling
By Riftwalker in forum Advanced JavaReplies: 2Last Post: 07-17-2007, 08:16 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks