• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

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 ?
0
marss
Asked:
marss
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now