posted 10 years ago
I have JList that is loaded with Object<Domain> has its ListCellRenderer and mouseListener, here is the code:
MyListCellRenderer:
JList:
Domain class:
That is the setup. What am I doing is getting data from a data base and loading it to a JList. The next step is the one when I click on a row in the list I want another Jlist to load corresponding filed from a data base.
Everything is working fine. I get the right values at my terminal but when I try to load the values to the other JList the first one that triggered the job is acting strange.What I mean by acting strange is the following. The list that has a mouseListener attached to it has 9 Domain elements in it(it only shows Domain.getName()). When I make a selection(one click) I get the right data in the second Jlist loaded, but the selection marker moves in the first one on its own. It moves one spot down, and it happens 9 times, and I don't have a clue why is that happening.
This is the listener code:
Does anyone have a clue to whats going on here? Thanks