tags:

views:

30

answers:

1

I have created a JDialog to be opened when I click on the edit button of my JFrame, it is being opened properly and does'nt have any issue, but when I took this code on the windows ce 5.0 device this dialog is being opened twice. hat is i am clicking only once on the edit button but the dialog is appearing twice, I want there should be only one dialog appear on edit button click.

A: 

ok I have got the solution

public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting() == false) {
        List lsm = (List) e.getSource();
        showDialog();
        lsm.clearSelection();
    }
}
Bhaiyaji Patel
Reformatted code; please revert if incorrect.
trashgod
The predicate `!e.getValueIsAdjusting()` is a common alternative to `e.getValueIsAdjusting() == false`.
trashgod