Solved

Dispatching events to the event queue.

Posted on 1997-05-28
3
273 Views
Last Modified: 2010-04-16
I'm trying to generate an event and dispatch it to a component.  However, the only way I can find to do this is to use Component.deliverEvent() or Component.postEvent().  The problem with these functions is that they call Component.HandleEvent() directly.  Instead, I want to queue the event behind any other events currently waiting to be handled by the receivng component.  Is this possible and how do I queue and event?
0
Comment
Question by:dpon
  • 2
3 Comments
 
LVL 6

Expert Comment

by:jpk041897
ID: 1221033
I'm not actualy sure if it will help, but there is some excellent coverage on events at:

http://www.phrantic.com/scoop/Java000.htm

The info on these pages might give you some insight on how to solve your problem.

As an aside, since events can subcalsed, Have you conided writing your own dispatch table?
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1221034
Have you considered writting your own dispatch handler?
0
 
LVL 1

Accepted Solution

by:
mann061997 earned 100 total points
ID: 1221035
Use a statement similar to the following, e.g. to post a
MouseEvent:

    Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(
      new MouseEvent(myCustomComp,MouseEvent.MOUSE_CLICKED,
                     0,0,-1,-1,2,false));

More info is available at http://www.geocities.com/Athens/7077/Java104.htm
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question