aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 36465
    
  15
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.
 
Similar Threads
JList SelectionForeground problem when BOLD
JList Model Creation / Update
Problem with Adding items from JComboBox to JList
JComboBox and ItemListener
Set up Jlist