Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Using a cursor variable as a flag

Thread view: 
- - 20 May 2005 11:19 GMT
Presently, on mousePressed on a component, I set the Cursor to
MOVE_CURSOR.  In another unrelated method, I check whether the Cursor is
MOVE_CURSOR before processing something.  Is it okay to do that way
taking into account that other methods might chance the cursor in
different threads or should i use a boolean flag?
houbahop - 21 May 2005 02:34 GMT
Hi,
If others methods cannot change that value, I would have say that it's would
be a non academic but working way, but since you said that this flag must be
changed by somewhere else, you mustn't use that and set up a boolean flag,
Unless what you can have some debugging troubles because of some strange
behaviours of your app.

It is not related, but if however you albsolutely want to use this kind of
method , an idea is to make a function that the job will be to change this
value, and call this function everytime when you need to change the cursor
value. So, it will be easy to debug is there is only one entry point. Maybe
a parameter passed to the function can be an id of the caller to know easyly
which part of your code has launched the appeal that change the value. Well,
forget that now.

D.

> Presently, on mousePressed on a component, I set the Cursor to
> MOVE_CURSOR.  In another unrelated method, I check whether the Cursor is
> MOVE_CURSOR before processing something.  Is it okay to do that way taking
> into account that other methods might chance the cursor in different
> threads or should i use a boolean flag?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.