Re: JList getSelectedValue returning null
- From: Menno Holscher <menno.holscher@xxxxxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 16:46:27 +0100
soup_or_power@xxxxxxxxx wrote:
> Can anyone tell me why a JList based on the following model returns
> null?
> Thanks!
> private Vector data = null;
>
> public KeyValueListModel(Vector data) {
> System.out.println("hello10");
> if (null == data) {
> throw new NullPointerException("Null Pointer Exception in data");
> }
>
> this.data = data;
> }
>
The other posters on the thread had sensible comments. I think the key is in
the constructor above. "data" is initialized to null and if it is found to
be null in your constructor (which it always will be) it throws always when
you use this.
--
Groeten van/regards
Menno
.
- References:
- JList getSelectedValue returning null
- From: soup_or_power@xxxxxxxxx
- JList getSelectedValue returning null
- Prev by Date: Re: compare xml dom documents
- Next by Date: Newbie question.. reading location header
- Previous by thread: Re: JList getSelectedValue returning null
- Next by thread: FileInputStream in Servlet
- Index(es):
Relevant Pages
|