hooking up arrays of Listeners
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Aug 2007 20:13:18 GMT
I have doubly dimensioned arrays of widgets. I would like to set the
up with ChangeListeners -- each individual e.g.
rgbSlider[0][0].addChangeListener( new ChangeListener() {
/**
* Invoked when the target of the listener has changed its
state.
*
* @param e a ChangeEvent object
*/
public void stateChanged( ChangeEvent e )
{
int value = rgbSlider[0][0].getValue();
rgbDecSpinner[0][0].setValue( value );
}
} );
What is the cleanest way to pass the two subscript parameters to the
stateChanged method? or concoct a common listener that handles all 6
widgets?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- Follow-Ups:
- Re: hooking up arrays of Listeners
- From: Thomas Hawtin
- Re: hooking up arrays of Listeners
- Prev by Date: Re: Copying JPanel components to another JPanel
- Next by Date: Re: hooking up arrays of Listeners
- Previous by thread: Copying JPanel components to another JPanel
- Next by thread: Re: hooking up arrays of Listeners
- Index(es):