Article View: borland.public.jbuilder.java.swing
Article #612Re: Custom cursor gets changed back or wrong cursor gets used
From: Michael D. Spence
Date: Fri, 18 Mar 2005 22:51
Date: Fri, 18 Mar 2005 22:51
63 lines
3425 bytes
3425 bytes
"Michael D. Spence" <spence@panix.com> wrote in message
news:423b3a96$1@newsgroups.borland.com...
> "Lori M Olson [TeamB]" <javadragon@techie.com> wrote in message
> news:423b0e14$1@newsgroups.borland.com...
>> Michael D. Spence wrote:
>>
>>> I have a JPanel that is contained in a JInternalFrame. In response to a
>>> mouse click, the JPanel changes the cursor to a custom cursor while a
>>> database operation is going on, then changes it back to the previous
>>> cursor.
>>>
>>> This works fine on my development system, but when the app. is
>>> distributed to the user and they click on the JPanel, the cursor change
>>> only shows as long as the user keeps the mouse button pressed. As soon
>>> as they release the mouse, the cursor changes back.
>>>
>>> Also on my development system (and as one would expect), the custom
>>> cursor is replaced by the system default when it's moved outside of the
>>> applicaton window. But when the cursor is moved back onto my app
>>> window, it changes to a horizontal sizing cursor (double-ended arrow),
>>> which eventually changes back to the original default cursor on
>>> schedule, when the database operation completes.
>>>
>>> I have no idea what could be going on here. Help!
>>>
>>>
>>> ________________________
>>> Michael D. Spence
>>> Mockingbird Data Systems, Inc.
>>
>> Perhaps if you posted some of the mouse cursor setting code...
>>
>
> Sure. Here you are:
>
> Cursor c = this.getCursor();
> this.setCursor(dataUtils.getSqlCursor());
> try {
> ... Database work occurs here ...
> } finally {
> this.setCursor(c);
> }
>
>
> dataUtils returns a Cursor object, which works fine on my development
> system but not on the user's system.
>
> But just in case, instead of using that, I'm going to try this to see what
> happens:
>
> this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
>
Ok, using a regular wait cursor solves the second problem (where the cursor
is totally lost when
the mouse moves outside the app's main window), but I wonder if it'll solve
the first, where
the custom cursor is only displayed while the mouse button is held down.
I'm guessing this has something to do with the custom cursor not being
available to whatever deals
with the mouse leaving and re-entering the app window.
Technical Details
Message-ID:
<423b5b79@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<423af16e$1@newsgroups.borland.com> <423b0e14$1@newsgroups.borland.com> <423b3a96$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,f15ed9bbb83edfc5 X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Michael D. Spence" <spence@panix.com> From: "Michael D. Spence" <spence@panix.com> Newsgroups: borland.public.jbuilder.java.swing References: <423af16e$1@newsgroups.borland.com> <423b0e14$1@newsgroups.borland.com> <423b3a96$1@newsgroups.borland.com> Subject: Re: Custom cursor gets changed back or wrong cursor gets used Date: Fri, 18 Mar 2005 17:51:53 -0500 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 24.46.54.16 Message-ID: <423b5b79@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111186297 24.46.54.16 (18 Mar 2005 14:51:37 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail