in reply to Re^3: problem with Tk::JComboBox
in thread problem with Tk::JComboBox

In my code above, when you run it, and hit the down arrow on the top box, then browse the selections, the browsecmd callback will say Browse 1. So the selections to the top box only should change. BUT if you then proceed to the bottom box 2, it's selections will have been changed too, without browsing them.

The reverse is not the same. If you restart the app, and browse the lower box 2, it will change it's selections. Then proceed to the top box 1, and it's selections have not changed.

Also, if you browse box 1 first, it will print Browse 1 only when you actually browse the selections. Then if you go to the down arrow on box 2, it will print Browse 1, on the arrow press of box 2. Maybe it's a focus thing, but it sure seems like there is something wrong with the way the browsecmd works with multiple boxes.


I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^5: problem with Tk::JComboBox
by jethro (Monsignor) on Sep 22, 2008 at 23:06 UTC

    That is not a bug, it's a feature. JComboBox recognizes when you use the same var for more than one box. The first box is called the master, all the others observer. If you change the master, the observers follow.

    Really a strange "feature" IMHO, but it is documented, in the section "The Choices option" of the JComboBox docs

      That is not a bug, it's a feature...... a Really a strange feature

      Where have I heard that before? :-)


      I'm not really a human, but I play one on earth Remember How Lucky You Are