Article View: borland.public.jbuilder.java.swing
Article #12015Re: Wait cursor for short period
From: Cody Chale
Date: Mon, 08 Mar 1999 00:00
Date: Mon, 08 Mar 1999 00:00
29 lines
1527 bytes
1527 bytes
If the period of time is too short, the cursor may not change at all. Try putting a Thread.sleep in there and it should change. Also, I've found you often need to do a setCursor on the Frame to return back to the default cursor even though the initial setCursor was on the glassPane...swing bugs. -Cody George Tryfon wrote: > Inside in JFrame: > > Component g = this.getGlassPane (); > g.setCursor (Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); > g.addMouseListener (MyMouseListener); > g.setVisible (true); > > // some job... (a simple loop) > > g.removeMouseListener (MyMouseListener); > g.setCursor (Cursor.getDefaultCursor()); > g.setEnabled (false); > > but the wait cursor is never comes out. > What do I need for the wait cursor to appear for this short period ? > Do I need to make some kind of "yeld()" or "repaint()" before the loop ? > > Thank you in advance > George Tryfon > george@compucon.gr
Technical Details
Message-ID:
<36E4330C.CC93F83B@ultranet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7adu0q$8ia9@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d6dfc3263ce993f0 X-Google-Attributes: gid111d45,public From: Cody Chale <apogee08@ultranet.com> Subject: Re: Wait cursor for short period Date: 1999/03/08 Message-ID: <36E4330C.CC93F83B@ultranet.com> X-Deja-AN: 452641204 Content-Transfer-Encoding: 7bit References: <7adu0q$8ia9@forums.borland.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing