Results 1 to 2 of 2
- 08-13-2011, 05:47 PM #1Member
- Join Date
- Jun 2011
- Rep Power
How to handle multiple listeners on stateChanged
Until now, I only had a slider activitating stateChanged and to change page clicked on the tab: that didn't need any code from me, it just happened (I assumed it is inherent to tab properties). Now I need to know, within the code, when the tab is clicked - and that's where I get confused.
My stateChanged listener doesn't seem to leave any scope for alerting me of anything other than the slider being moved.
Code for slider:
public void stateChanged(ChangeEvent e)
JSlider slider1 = (JSlider)e.getSource();
sensitivity = (int)slider1.getValue();
How do I incorporate a "tab-selected" option within the listener?
- 08-13-2011, 06:24 PM #2
- By JavaStudent1990 in forum New To JavaReplies: 8Last Post: 08-10-2010, 02:59 AM
- By StormyWaters in forum AWT / SwingReplies: 14Last Post: 06-11-2010, 08:28 PM
- By hanifa in forum AWT / SwingReplies: 4Last Post: 09-19-2008, 07:58 AM
- By int80 in forum New To JavaReplies: 5Last Post: 07-18-2008, 04:30 PM
- By Java Tip in forum Java TipReplies: 1Last Post: 01-03-2008, 11:06 AM