Mouse cursor not showing...

I'm tryin to show a Cursor.WAIT_CURSOR
with my JFrame but it only shows for a very short while, if at all....

JFrame mainFrame;

Cursor old_cursor = mainFrame.getCursor();
mainFrame.setCursor(new Cursor(Cursor.WAIT_CURSOR));

...

mainFrame.setCursor(old_cursor);


I use swing and jdk 1.2.1

anyone ?
marssAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

heyhey_Commented:
>> ... but it only shows for a very short ....


mainFrame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
// ...
// very short time ? :)
// ...
mainFrame.setCursor(old_cursor);


0
marssAuthor Commented:
sigh,

the ... are a lot of code being executed taking at least 3 to 5 sek.

:)

 
0
marssAuthor Commented:
ok,

i've tried to set the cursor for a JEditorPane and it works fine but do i really have to set the cursor for every component on my jframe !?


marss
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

heyhey_Commented:
not sure but try

frame.getContentPane().setCursor()
0
marssAuthor Commented:
ok,

i've tried to set the cursor for a JEditorPane and it works fine but do i really have to set the cursor for every component on my jframe !?


marss
0
conickCommented:
The standard way to set the cursor is on the glasspane.
The glasspane exists over your frame (its hidden by default.. but you can make it visible)
You can draw on this pane, intercept events (or you need to send them on), or set the cursor.

Check our the Java Tutorial for a pretty decent example.  (The GUI section, i believe there is a link to glasspanes where it talks about JFrame and RootPanes.
0
sgomsCommented:
even glassPane does not work. i tried all the possibilities.
ContentPane, RootPane..
in SWING,
"Cursors are set on a component-by-component basis. If you want to use a custom cursor with
an object and all of its children, you must explicitly set the cursor for each object that you want to use the cursor"

so that is ur answer marss. you have to set it on a component-to-component basis.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.