[jsword-devel] BooksComboBoxModel problem

DM Smith jsword-devel@crosswire.org
Wed, 24 Mar 2004 17:50:20 -0500


I am working on solving a problem with the BooksComboBoxModel.

The problem is that when a book is added the selection is not adjusted.
When a user adds a first book, that book is not selected.
If a user uninstalls/deletes the last book, the selection is not set to -1.

The solution is fairly straight forward:
Override cacheBooks
save off the currently selected book, if any.
call the super cacheBooks
Find the currently selected book and set it.
If it is not there and there is at least one book in the list set it to one 
of the books.

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/