Thread View: borland.public.jbuilder.java.swing
5 messages
5 total messages
Started by Michael D. Spence
Fri, 18 Mar 2005 15:19
Custom cursor gets changed back or wrong cursor gets used
Author: Michael D. Spence
Date: Fri, 18 Mar 2005 15:19
Date: Fri, 18 Mar 2005 15:19
22 lines
1982 bytes
1982 bytes
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.
Re: Custom cursor gets changed back or wrong cursor gets used
Author: Lori M Olson [TeamB]
Date: Fri, 18 Mar 2005 17:21
Date: Fri, 18 Mar 2005 17:21
47 lines
2675 bytes
2675 bytes
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...
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Re: Custom cursor gets changed back or wrong cursor gets used
Author: 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));
Re: Custom cursor gets changed back or wrong cursor gets used
Author: 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.
Re: Custom cursor gets changed back or wrong cursor gets used
Author: Lori M Olson [TeamB]
Date: Sat, 19 Mar 2005 01:10
Date: Sat, 19 Mar 2005 01:10
38 lines
2379 bytes
2379 bytes
Michael D. Spence wrote:
> 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.
>
>
I think you need to learn a lot more about how the cursor works and
responds to mouse events/listeners.
Until you learn that, using a GlassPane will probably help:
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/swing2.html
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads