File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Adding Items to Jlist using JComboBox. Problem with avoiding duplicates. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

Adding Items to Jlist using JComboBox. Problem with avoiding duplicates.

rayan alex
Ranch Hand

Joined: Nov 25, 2012
Posts: 33
    
    1
Hi,

In the following program, Im trying to add some items to Jlist using JComboBox without any duplicates.
I managed to add items with Duplicates, As well as I managed to find duplicates using this condition (combo.getSelectedItem().equals(listModel.getElementAt(i)) )
But when i add else statement, program didnt wiork. Please help me to understand where is the error of this program,
Thank you in advance.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Closing as a duplicate of the question in this thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Items to Jlist using JComboBox. Problem with avoiding duplicates.