• Post Reply Bookmark Topic Watch Topic
  • New Topic

setSelectedValue in JList doesn't scroll - Urgent!

 
alex earnshaw
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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 ]
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!