[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set hour glass

Posted on 2006-03-30
9
Medium Priority
?
471 Views
Last Modified: 2011-09-20
I have a menu item by using process in java I call another class . I want to ask how can I change the mouse pointer to hour glass until the process is not completed.
0
Comment
Question by:mattjulius
  • 5
  • 3
9 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 16340209
0
 
LVL 37

Expert Comment

by:zzynx
ID: 16340212
In your case: use Cursor.WAIT_CURSOR
0
 
LVL 92

Expert Comment

by:objects
ID: 16340255
call the setCursor(Cursor.WAIT_CURSOR) method for the component you want the hourglass to appear over (ie. when the cursor is over that component.
If you want it for the whole frame then set it for the frames content pane
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:mattjulius
ID: 16340268
to zzynx:

I already have that but how can I do it while in process.
0
 
LVL 92

Expert Comment

by:objects
ID: 16340272
You need to call on the event disspatch thread

so call it before you start your processing thread, or call it using EventQueue.invokeLater()

0
 
LVL 37

Expert Comment

by:zzynx
ID: 16340280
>> how can I do it while in process
yourComp.setCursor(Cursor.WAIT_CURSOR);

// do your call that doens't return until done

yourComp.setCursor(Cursor.DEFAULT_CURSOR);
0
 
LVL 92

Expert Comment

by:objects
ID: 16340284
component.setCursor(Cursor.WAIT_CURSOR);

// start your processing thread now



And in your processing thread you set it back:


public void run() {

    // do your processing here

    EventQueue.invokeLater(new Runnable() {
       public void run() {
          component.setCursor(original);
       }
    });
}

0
 
LVL 37

Accepted Solution

by:
zzynx earned 165 total points
ID: 16340309
0
 
LVL 37

Expert Comment

by:zzynx
ID: 16358191
Thanx 4 axxepting
What answer did you expect to award it with an A grade?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question