Can I set the selected item for a JList without having an event thrown to the listeners?

前端 未结 2 686
我寻月下人不归
我寻月下人不归 2021-01-19 04:41

I am working on a viewer, which uses a JList to show thumbnails of the pages of a document. The user can open a page by selecting it through in the JList, or throught other

2条回答
  •  耶瑟儿~
    2021-01-19 05:05

    It looks like setSelectedIndex() is just a convenient way to set the selection in the ListSelectionModel. Maybe your ListModel could flag or cache the result so it won't get loaded a second time.

提交回复
热议问题