Results 1 to 2 of 2
  1. #1
    Cleeve is offline Member
    Join Date
    Jun 2011
    Posts
    14
    Rep Power
    0

    Default 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();
    if (!slider1.getValueIsAdjusting())
    {
    sensitivity = (int)slider1.getValue();
    }
    }

    How do I incorporate a "tab-selected" option within the listener?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,238
    Rep Power
    19

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2010, 02:59 AM
  2. Question on Multiple Listeners implementation
    By StormyWaters in forum AWT / Swing
    Replies: 14
    Last Post: 06-11-2010, 08:28 PM
  3. JSlider (to NOT cont'd trigger statechanged )
    By hanifa in forum AWT / Swing
    Replies: 4
    Last Post: 09-19-2008, 07:58 AM
  4. Replies: 5
    Last Post: 07-18-2008, 04:30 PM
  5. Multiple listeners per event
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 01-03-2008, 10:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •