| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
...I have some other controls. One JButton is labeled: "Set Default Input". A nice control to have. But when the user presses this button, up to 44 JComboBoxes have setSelectedItem () called on them, which fires at least 44 events, which in the action listeners sometimes call setSelectedItem() to make sure their "paired" JComboBox has a consistent selection, and these method calls fire still more events. I have JComboBoxes to insert layers, remove layers, and set the number of layers in the geology. I also have a button to set the inputs to the exact condition they had for a previous saved calculation. All of these involve calling setSelectedItem().The problem here is that you're not using the ComboBox model. It has a setSelectedItem method that notifies the JComboBox to change it's displayed item. However this doesn't trigger an action event. It will trigger a ListDataEvent which will notify any other objects or models that the value has changed.
| References: | |
| >Re: How to distinguish between user selection and programatic selection with ListSelectionListener (From: "John St. Ledger" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.