No subject


Sat Nov 12 19:29:10 PST 2005


"normal"
"waiting for point click"

You then need one or more variables to keep track of the 
state of your GUI. You should declare the variables in the
controller class of the GUI component. Usually the main panel.

When the menu item "point click" is selected you could 
disable all other commands. When you receive the
mouse click you can enable them. 

I would suggest a slightly different approach, though. Instead of
disabling all other commands, let the other commands
cancel the "point click" command. That is how most other apps
handle that kind of situation.
--
Klas


--- In advanced-java at egroups.com, "Sergio" <silarri at t...> skrev
> I have a little application in which the user selects an option to register
> the point in the screen where he/she clicks.
> 
> The problem is that the method in which the clicked point is registered is
> executing in the event dispatching thread, since it is executing in response
> to a selected option.  In this method, I want to wait for a mouseClick
> event.  However, if I don't return from that method, the mouseClick event is
> never handled (since it must be handled also in the event dispatching
> thread).
> 
> I'd like that, when this method returns, the clicked point is already
> registered.
> I'd like also, if it's possible, that, until this method returns, the user
> cannot select any other option in the menu (that is to say, when the user
> requests to register a clicked point, the first thing he/she has to do is
> clicking on the screen).
> 
> I've tried with a SwingWorker and with a busy loop, but, obviosly, these
> approaches don't work.
> 
> Is it possible to do what I want?.  How can I do that?.
> 
> Thanks a lot.
> 

---
To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
To get help, mail advanced-java-help at xcf.berkeley.edu



More information about the Advanced-java mailing list