• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

setSelectedValue in JList doesn't scroll - Urgent!

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please can you help with the following:
Here is an extract of the code I am using.

The result is that when the dialog contianing the list is displayed, all of the items in listData are displayed in the list and the initialValue item is selected (highlighted). A vertical scrollbar appears at the right side of the list. My problem is this - the list can contain many items (100) and if the initialValue item is toward the end of the list, it is selected but not scrolled into the view, i.e. I have to manually scroll down to see the selected item. I thought that the second argument to the method setSelectedValue is used to tell the list to scroll the selected item into the view, but in my case it does not seem to work.
I am using jdk1.3
Can anyone tell me what I am doing wrong???

Thanks in advance
Alex
[ June 11, 2002: Message edited by: alex earnshaw ]
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,
You are not doing anything wrong. This is a known bug in 1.3.x. It worked in 1.2 but due to some other fix for 1.3.x it broke. I think it was fixed in 1.4. The bug report:
http://developer.java.sun.com/developer/bugParade/bugs/4457325.html
Regards,
Manfred.
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic