Re: Removing an item from a Jlist
- From: TheBigPJ <TheBigPJ@xxxxxxxxx>
- Date: Thu, 28 Feb 2008 08:55:57 -0800 (PST)
On 28 Feb, 15:49, christopher_bo...@xxxxxxxxxxx wrote:
On 28 Feb, 14:47, TheBigPJ <TheBi...@xxxxxxxxx> wrote:
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);
}
Did you before hand do this?
tempListModel = new DefaultListModel();
tempListModel.addElement("First");
tempListModel.addElement("Second");
tempListModel.addElement("Third");
lstComputerExceptions = new JList(templistModel);
Peter,
.
- 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: Removing an item from a Jlist
- Next by Date: Re: displaying prompts and reading user input question
- Previous by thread: Re: Removing an item from a Jlist
- Next by thread: Re: Removing an item from a Jlist
- Index(es):
Relevant Pages
|
|