CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Posts
    7

    Posting an Event asynchronously....

    Hi,

    I wanted to post an action Event from a procedure asynchronously. I did
    some thing like this

    EventQueue eq= Toolkit.getDefaultToolkit().getSystemEventQueue();
    eq.postEvent(new
    ActionEvent(button,ActionEvent.ACTION_PERFORMED,null));


    This piece of code works fine if the button is an AWT component. But doesn't
    work if it is a Swing component (JButton in this case).

    Can any one help me understand how to send to send events to swing
    components asynchronously.

    If a reply could also be copied to [email protected] , I'd really
    appreciate it.


    With regards,
    Lachu
    [email protected]




  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Posting an Event asynchronously....

    I don't think that swing classes understand events sent by JDK1.0 standards. I think u r trying to send events using that standard. As far as I know it won't work.

    Why don't u shift to Listener/Adapter methodology of events. Swing and awt recognize this method.

    - UnicMan
    http://members.tripod.com/unicman

  3. #3
    Join Date
    Aug 1999
    Posts
    7

    Re: Posting an Event asynchronously....

    Hi Mr UnicMan,
    The problem is if I follow the Listener/Adapter methodology of events, It will be synchronous. Can we send using Listener/Adapter events asnchronously.

    Thanx in advance
    Lachu



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured