JList and value change

Hello,

I have 2 jlist in a jpanel. In my value change method for jlist1, when I select an item in jlist1 I would also select the same item in jlist2 if it exists. Jlist2's value method also does the same. However, when I do a setSelectedValue in either jlist1 or jlist2 the other jlist value change gets called. I'm wondering if there is a way to stop that call.

Any help is much appreciated. Thanks

vyang

[434 byte] By [vyanga] at [2007-11-27 6:38:59]
# 1

jlist2.removeTheListener

jlist2.setSelectedValue(...)

jlist2.addBackTheListener

or add a boolean flag

flag = true

jlist2.setSelectedValue(...)

flag = false

jlist2.listener()

{

if(flag == false)

{

//normal code goes here

}

}

Michael_Dunna at 2007-7-12 18:07:56 > top of Java-index,Desktop,Core GUI APIs...