The Artima Developer Community
Sponsored Link

Java Answers Forum
Event Queue Behavior

1 reply on 1 page. Most recent reply: Apr 12, 2002 1:09 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Mohit Gupta

Posts: 15
Nickname: mohit
Registered: Mar, 2002

Event Queue Behavior Posted: Apr 12, 2002 11:14 AM
Reply to this message Reply
Advertisement
i am facing a problem with event queue befavior..that is as follow..

suppose i have a JButton and i want to perform any operation on its mousePress and mouseRelease event.
i show a input dialog Box on mouse press and ask user for input. and then i want to use this entered value in mouse release. but as this dialog box comes into picture, the current thread dump untill we enter value in dialogBox and till then the rest of the events on queue flush out after performing their operation and so is with mouseRelease event that i want to use for any specific operation with entered value..
so this is the problem that mouse release fired before mousePress complete..

is there any way to overcome this problem?? plz suggest me any soln, workaround for it..

i am trying to alter my application's reqd behavior from these events but perhaps this is required.


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Event Queue Behavior Posted: Apr 12, 2002 1:09 PM
Reply to this message Reply
I read your question twice, but I couldn't quite understand what your problem is, or what exactly you are trying to do. Are you trying to record the position of the mouse at the time of the click, or something like that?

Here's an idea that may help, or may just make more of a mess (in which case, you can exercise the full money-back guarantee). If you are opening a modal dialog in your event handler and that is somehow interfering with the flow you want, then maybe you could either start a thread, or fire a timer in your event handler instead. The thread or timer would then open the modal dialog at a slightly later time, allowing you to continue processing.

On the other hand, it may simply be a matter of doing whatever it is you wanted to do before opening the dialog box.

Flat View: This topic has 1 reply on 1 page
Topic: is it possible to copy dynamic data from applet Previous Topic   Next Topic Topic: Java programming on hand-held computers

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use