how to fire ItemStateChanged event

Discussion in 'Java' started by Wizumwalt@gmail.com, Oct 17, 2005.

  1. Guest

    Is there anyway for me to programatically fire an ItemStateChanged
    ItemEvent on a class w/ ItemListener? Basically, I need to select a
    certain tab from my JTabbedPane when my actionPerformed() method from a
    JTree is selected.

    Any help much appreciated.
     
    , Oct 17, 2005
    #1
    1. Advertising

  2. Vova Reznik Guest

    wrote:
    > Is there anyway for me to programatically fire an ItemStateChanged
    > ItemEvent on a class w/ ItemListener? Basically, I need to select a
    > certain tab from my JTabbedPane when my actionPerformed() method from a


    Why not just yourTabbedPane.setSelectedIndex(int index);
    ?
    > JTree is selected.
    >
    > Any help much appreciated.
    >
     
    Vova Reznik, Oct 17, 2005
    #2
    1. Advertising

  3. Roedy Green Guest

    On 17 Oct 2005 07:59:00 -0700, ""
    <> wrote or quoted :

    >Is there anyway for me to programatically fire an ItemStateChanged
    >ItemEvent on a class w/ ItemListener? Basically, I need to select a
    >certain tab from my JTabbedPane when my actionPerformed() method from a
    >JTree is selected.


    The easiest way is to call the method with a fake Event.

    The next easiest way is to construct a synthetic event and add it to
    the queue. see http://mindprod.com/jgloss/events11.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 17, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manoj Nair
    Replies:
    0
    Views:
    1,532
    Manoj Nair
    Sep 12, 2003
  2. Replies:
    16
    Views:
    647
    Jarek Zgoda
    Aug 1, 2005
  3. Replies:
    4
    Views:
    558
  4. Guest

    Fire server side event before client side event

    Guest, Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    628
    Ken Cox [Microsoft MVP]
    Mar 18, 2005
  5. Andy Fish

    load event doesn't fire unless init event is present

    Andy Fish, Jun 28, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    284
    Jonathan Mast
    Jul 7, 2005
Loading...

Share This Page