JList does not show selected value
Posted on 2000-03-28
I have a program where I use a username and password to get into a database. When I log in, I have a JList added to a scroll pane. In that JList I have list of all the users. I would like it to select automatically the name of the user who is logged in and scroll down to that name. I used
jlist.setSelectedValue(username, true), but it just selects the name but does not scroll down to it. I did not use Viewport for this scrollpane. Any advice?