• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Scrollpane doubt  RSS feed

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a list box in a JScrollPane. I want the scrollpane's vertical scrollbar to move to the last item in the list box whenever an item is added to the listbox dynamically.

I have written the following code



But the vertical scroll bar is always set at a position 1 item above the newly added item. I want the scrollbar to be set at the last position so that the newly added item is visible
How do i do this

Do reply me

regards
smriti
 
Smriti Anchu
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got the solution.
Use ensureIndexIsVisible(selectindex) method on the listbox once a data is entered.

eg:


Now the newly added data in the listbox is visible

bye
smriti
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!