Solved

Dispatching events to the event queue.

Posted on 1997-05-28
3
264 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
Comment Utility
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
Comment Utility
Have you considered writting your own dispatch handler?
0
 
LVL 1

Accepted Solution

by:
mann061997 earned 100 total points
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now