I've been looking into a similar problem. Seems like there are really two
issues here - first, the logic for determining when to show the hourglass
and, second, the Swing mechanism used to show the hourglass (e.g. setting
the cursor for the topmost window/frame vs. using a glasspane). I understand
your question about the first issue, but could you tell us more about what
problem you are having with the second? You say "A SetCursor on the frame
does not change the cursor for most of the frame's guts...". Could you give
an example of what you mean?  Also, could you give an example of this, too:
"Adding glasspane manipulation gets the cursor to show but adds UI
manipulation outside the event thread." 

We've been using a glasspane to shows a wait cursor and also to disable the
UI. To disable the UI we simple add a (no nothing) mouse listener to our
applet's glasspane, make it show a wait cursor, and then make the glasspane
active (ie. 'visible'). This approach works well, with one exception - I've
noticed odd behavior with modal dialogs. I am not sure whether the dialog is
still 'underneath' the applet's glasspane. It is also possible that, because
we post a call on the event queue to make the glasspane visible, it doesn't
fire until after the dialog is closed. (But i don't know enough about the
event queue(s) and modal dialogs to know how that is possible). Is that the
same type of problem you are seeing?

-----Original Message-----
From: Dan Snider [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 5:32 PM
To: 'Diane Turcotte'; Harish Prabhu; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: HourGlass Cursor


The WaitCursorEventQueue technique does not appear to work under 1.3. A
SetCursor on the frame does not change the cursor for most of the frame's
guts (is everyone else seeing this??). Adding glasspane manipulation gets
the cursor to show but adds UI manipulation outside the event thread. I like
the idea and think it's useful but don't readily see a safe way to make the
WaitCursorEventQueue approach work. Does anybody else?

Further, does anybody see a convenient way to get an application wide busy
cursor under 1.3? For the busy-cursor to show everywhere, the glasspane
needs to be used on every non-modal window. I don't believe there is an easy
way to query all windows either (application frame doesn't hold it's dialogs
for example) so a WindowMgr is also needed to collect the application
windows.

Any thoughts on an effective busy-cursor approach are welcome...

Dan


> -----Original Message-----
> From: Diane Turcotte [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 01, 2001 10:44 AM
> To: Harish Prabhu; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: HourGlass Cursor
> 
> 
> This article should help:
> 
> http://www.javaworld.com/javaworld/javatips/jw-javatip87.html
> 
> Good Luck,
> Dianne
> 
> At 03:35 PM 3/1/01 +0000, Harish Prabhu wrote:
> >Hi Everybody,
> >I am having a problem with setting the hourGlass Cursor for 
> the whole Frame.
> >I have a Main Jframe in which i display a Modal Dialog. I 
> have a search 
> >button on the modal Dialog which will populate the Modal 
> Dialog . This 
> >search takes quiet a while and so I display a HourGlass 
> Cursor for the JDialog.
> >But when i move the cursor out of the Modal Dialog area to 
> some other area 
> >of the screen it changes back to the default cursor.
> >I tried setting the Cursor for the MainFrame but since the DIalog is 
> >modal.. the main frame Cursor doesnt change till I close the modal 
> >Dialog.Can you please help me out ..
> >
> >Thanks in advance for your help
> >harish
> >_____________________________________________________________
> ____________
> >Get Your Private, Free E-mail from MSN Hotmail at 
> http://www.hotmail.com.
> >
> >_______________________________________________
> >Advanced-swing mailing list
> >[EMAIL PROTECTED]
> >http://eos.dk/mailman/listinfo/advanced-swing
> 
> _______________________________________________
> Advanced-swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/advanced-swing
> 
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to