File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame" Watch "Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame" New topic
Author

Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame

jaibardhan Ruwari
Greenhorn

Joined: Jul 18, 2010
Posts: 5
Hi,
In our application we using swing cursor when processing data using below snippet code in parent-child window.

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

Code reset cursor back to default after logic processing without any exception.

But after closing this child frame by close event or clicking some control on this frame, when it comes into parent window its show hourgalss instead of default(pointer).


1)This type of behaviour of frame shown only when opening frame over Model Layer but work fine in case of opeing over default layer .

2) When using jdk 1.6

If we explicitly set cursor to default at closing or other event even then it shows hourglass cursor.

Please suggest.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

luck, db
There are no new questions, but there may be new answers.
jaibardhan Ruwari
Greenhorn

Joined: Jul 18, 2010
Posts: 5
Darryl,
App having a main window with toolbar and menus etc.
Inside this main window there is another frame(JInternal frame), from where user can open different screens (frames).So its a Parent child relationship between the JInternal frames.

1) When open a window (JInternal Frame over Model Layer), we used the above cursor code for processing from busy to default cursor mode and work fine reset cusor back to default.
(pointer) after processing but when we close the frame by close button cursor comes back into the hourglass mode on parent window.
2) There are no such issue when we open same frames over Deafult Layer.
3) Issue over Model Layer only appears when using JDK1.6 but working fine in JDK1.5.

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2090
    
    7
That description is NOT a SSCCE!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame
 
Similar Threads
problem with internalframe glassPane
how to refresh child window when triggering a event in parent window using JAVA code not java scri
Question on window.opener
Change cursor
How to do Hourglass cursor in Javascript?