Menu

#7 List.setTrackItem throws an exception

open
Filip
Widget (8)
0.9.6
5
2012-04-09
2012-02-22
Gerrit Hohl
No

List.setTrackItem throws an exception if the list is not yet visible.
Seems there is problem with the calculation of the visible size for the paging as it isn't yet visible: If the widget wasn't visible before, the property "private Rectangle _size;" is null and not initialized. The result is a NullPointerException:

java.lang.NullPointerException
at jcurses.widgets.Widget.getSize(Widget.java:176)
at jcurses.widgets.List.getVisibleSize(List.java:412)
at jcurses.widgets.List.getPaging(List.java:488)
at jcurses.widgets.List.getPageNumber(List.java:495)
at jcurses.widgets.List.findNextSelectableItem(List.java:436)
at jcurses.widgets.List.setTrack(List.java:581)
at jcurses.widgets.List.setTrackedItem(List.java:570)
... and so on ...

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.