Re: Removing an item from a Jlist



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,
.



Relevant Pages

  • FYI ... who you are and where you are
    ... I have seen several replies to technical questions that clearly indicate ... If I cant find it on their website, then they don't have a shot at getting ... we want to do business with a business. ... My gut feeling is that Delphi is growing in use in the commercial ...
    (borland.public.delphi.non-technical)
  • Re: HTTP Tunnelling
    ... PLEASE post all messages and replies in the newsgroups ... > proxy number.We are under our clients domain. ... > is- if we enter the proxy server number & go to our ... > clients website & enter the website what we want to visit ...
    (microsoft.public.windowsxp.network_web)
  • Re: HELP intranet.domain.com and www.domain.com no longer working
    ... Probably, but by not including the history of the replies, you are making it ... How to create a new website in SharePoint: ... > can I ping projects.lloydresearch.com I created a web publishing rule ...
    (microsoft.public.windows.server.sbs)
  • Re: Popeye are you for real?
    ... Let the mayhem continue in other words. ... post the e-mails on my website. ... -no one- wants to see your replies. ... but they have never found these dangers sufficient ...
    (misc.transport.trucking)
  • Lets have the votes from other posters too.
    ... Let the mayhem continue in other words. ... then post the e-mails on my website. ... -no one- wants to see your replies. ... because of your above reasons. ...
    (misc.transport.trucking)