swing - Java JComboBox control scrollbar position? -


i'm working on simple java program (using netbeans' swing gui builder). you're supposed select randomly placed item jcombobox fast can, tell time , save (keeping statistics , whatnot).

problem is, once select item , go find different item (in new random position in jcombobox), scrollbar seems have remembered it's previous position.

since game supposed competitive, wouldn't fair scrollbar in previous player's position.

is there way set position of scrollbar in jcombobox?

p.s. it's vertical scrollbar. also, did try find answer online, couldn't find after on 2 hours of searching. appreciated!

select first item scrollbar goes top, set selection -1.

combobox.setselectedindex(0); combobox.setselectedindex(-1); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -