Skip to main content

Hourglass cursor issue over Model Dialog

No replies
jaibardhan
Offline
Joined: 2010-12-10
Points: 0

Hi Everyone,

I am facing a hourglass cursor issue in my application. We have a main application window with menus and toolbar inside this app window there is another window with tree from where user can open different screens,For user different input event (tab ,button click etc) we have to show hourglass(waiting) and default(pointer) cursor.

For that we have write our EventQueque and ThreadTimer class for managing all user events and setCursor() call explicitly through dispatchEvent() method of EventQueque class and set delay for waiting by implementing ThreadTimer class startTimer() and stopTimer() method same as given below link.

http://www.javaworld.com/javaworld/javatips/jw-javatip87.html?page=3

Now we explicitly call setCursor method for screen processing using below code sinppet like in given manner in the Link of Hourglass cusor

try{
component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// Code for processing
// Code for processing
}catch (Exception e) {
e.printStackTrace();
}finally{
component.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

Code works fine initialy set cursor to hourglass at begining of code and reset it back to default at the end of code and window showing with hourglass and then pointer ,but when we close this window hourglass cursor appears over parent window.

This issue appears only if we open the JInternalFrame over the Model Layer but works fine if JInternalFrame open over default layer

Please suggest...