Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dispatching events to the event queue.

Posted on 1997-05-28
3
Medium Priority
?
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

604 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