This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
UPDATE: Perhaps there is more elegant/better way to do this?
When comboBox (line 34) is clicked the MouseListener (line 38) calls method "userNames()" (line 51), which sets up a connection to the database and returns an ArrayList. PopupMenuListener "srcListener" (line 8) calls the method "userNames()" and adds it to the comboBox (line 34). Problem: When Mouse Listener activates, combo box population occurs multiple time (should be only once). Another problem is that everytime mouse listener is triggered it appends the ArrayList to the combo box, should delete the existing list before adding the new combo box.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Adding addPopupMenuListener to JCombo Box through Mouse Event