Re: Removing an item from a Jlist
- From: GArlington <garlington@xxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 03:53:56 -0800 (PST)
On Feb 28, 3:49 pm, christopher_bo...@xxxxxxxxxxx wrote:
On 28 Feb, 14:47, TheBigPJ <TheBi...@xxxxxxxxx> wrote:<snip>
I think this link will satisfy your needs and maybe more.
http://java.sun.com/docs/books/tutorial/uiswing/components/list.html
Hi all. Thanks for the replies. I have had a look at the website
mentioned above by TheBigPJ and have entered the following the code
into my program:
int index = lstComputerExceptions.getSelectedIndex();
lstComputerExceptions.remove(index);
lstComputerExceptions.setSelectedIndex(index);
lstComputerExceptions.ensureIndexIsVisible(index);
}
However when I run it always comes up with the following error
message:
ception occurred during event dispatching:
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1
I suspect that the error refers to line of code
= lstComputerExceptions.setSelectedIndex(index);
If you look at the line immediately preceding that one you might see
what may be causing the error...
.
- References:
- Removing an item from a Jlist
- From: christopher_board
- Re: Removing an item from a Jlist
- From: TheBigPJ
- Re: Removing an item from a Jlist
- From: christopher_board
- Removing an item from a Jlist
- Prev by Date: Re: Trouble using POST method with servlet
- Next by Date: Re: Trouble using POST method with servlet
- Previous by thread: Re: Removing an item from a Jlist
- Next by thread: displaying prompts and reading user input question
- Index(es):