The Artima Developer Community
Sponsored Link

Java Answers Forum
Delete items from an Icon and String JList

1 reply on 1 page. Most recent reply: Mar 1, 2004 5:59 AM by Daniel Liu

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Daniel Liu

Posts: 11
Nickname: hhliu
Registered: Feb, 2004

Delete items from an Icon and String JList Posted: Feb 29, 2004 2:56 AM
Reply to this message Reply
Advertisement
Hello,

I need delete some items from an Icon and String JList.

Every time I select an item randomly from the list and then click a delete button, it goes to delete the last item of the list.

The following is the code segment I wrote:

personSelectedIndex = personList.getSelectedIndex();

personModel.removeElementAt(personSelectedIndex);

Also, I tried the following code:
personValue = personList.getSelectedValue();

personModel.removeElement(personValue);

It works the same as the previous two lines.

Does any body know the reason?

Thanks,

Daniel


Daniel Liu

Posts: 11
Nickname: hhliu
Registered: Feb, 2004

Re: Delete items from an Icon and String JList Posted: Mar 1, 2004 5:59 AM
Reply to this message Reply
The problem has been solved.

Thanks.

Flat View: This topic has 1 reply on 1 page
Topic: Video in Java Applet Previous Topic   Next Topic Topic: How to combine subfunction into Main Program

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use