Article View: borland.public.jbuilder.java.swing
Article #611Re: Custom cursor gets changed back or wrong cursor gets used
From: Michael D. Spence
Date: Fri, 18 Mar 2005 20:31
Date: Fri, 18 Mar 2005 20:31
49 lines
2872 bytes
2872 bytes
"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));
Technical Details
Message-ID:
<423b3a96$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.freenet.de!80.239.136.19.MISMATCH!tsicnews.teliasonera.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<423af16e$1@newsgroups.borland.com> <423b0e14$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> Subject: Re: Custom cursor gets changed back or wrong cursor gets used Date: Fri, 18 Mar 2005 15:31:28 -0500 Lines: 51 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: <423b3a96$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111177878 24.46.54.16 (18 Mar 2005 12:31:18 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.freenet.de!80.239.136.19.MISMATCH!tsicnews.teliasonera.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail