Article View: borland.public.jbuilder.java.api
Article #3019Re: 'application-modal' cursor?
From: John P. McGrath
Date: Mon, 25 May 1998 00:00
Date: Mon, 25 May 1998 00:00
34 lines
1815 bytes
1815 bytes
Torsten Welches <torsten.welches@netcologne.de.NO_SPAM> wrote in article
<354f7d05.6948651@forums.borland.com>...
> Here is what I've chosen as a workaround so far to get the default
> cursor for any type of component. Kinda overkill, but anyway...
>
> static Cursor getComponentDefaultCursor(Component component) {
> Cursor result = null;
> try {
> result =
> ((Component)component.getClass().newInstance()).getCursor();
> } catch (Exception ex) {...}
> return result;
> }
Instead of trying to figure out the default cursor, you could save the
Cursor settings for each Component when you set the cursor to a WAIT cursor
(I guess a Vector would be the appropriate structure to use). Then, to
restore the cursor, just iterate through the Vector, setting each
Component's cursor to its original setting.
This would have two advantages over the other approach:
1) It would probably be more efficient. Constructing all of those
components has got to cost, even if they are never shown.
2) If the component had changed its cursor from the default value, this
would restore the cursor to the correct value.
--
John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID:
<01bd87b4$95373c10$0e47aacc@ferd>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3548b5f2.16008549@forums.borland.com> <3548FAB1.4FCED55E@corp.borland.com> <354a637d.975011@forums.borland.com> <354DFB43.79A8D94F@corp.borland.com> <354f7d05.6948651@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,bc31dbc8cc333df X-Google-Attributes: gid1089d0,public From: "John P. McGrath" <mcgrath@enter.net> Subject: Re: 'application-modal' cursor? Date: 1998/05/25 Message-ID: <01bd87b4$95373c10$0e47aacc@ferd> X-Deja-AN: 356265295 References: <3548b5f2.16008549@forums.borland.com> <3548FAB1.4FCED55E@corp.borland.com> <354a637d.975011@forums.borland.com> <354DFB43.79A8D94F@corp.borland.com> <354f7d05.6948651@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.api