🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12950

Can anyone help with a problem on Cursors?

#12950
From: Peter Hawkins
Date: Mon, 12 Oct 1998 00:00
54 lines
1992 bytes
Hi,

I have a swing application which reacts to a button press by calling a
method in another class. This method makes a network connection to
another host, retrieves some data and returns. I thought that it would
be good to set the cursor to the WAIT_CURSOR before the method call and
reset it on return to give the user some indication that something is
happening.

However I find that the cursor does not get updated until the method
returns, in which case it immediatly gets set back again. The code looks
something like this:


<In the button event handler>

ResponseArea.setCursor(new Cursor(WAIT_CURSOR));

---> call the method which does the network stuff.

ResponseArea.setCursor(new Cursor(DEFAULT_CURSOR));


<end of button handler>


When run it acts like this:

<In the button event handler>

---> call the method which does the network stuff.

ResponseArea.setCursor(new Cursor(WAIT_CURSOR));
ResponseArea.setCursor(new Cursor(DEFAULT_CURSOR));


<end of button handler>

It seems like the ResponseArea component (JTextPane) has to wait on the
method call finishing before it can update the cursor by which time it
is too late.


Anyone have any ideas


Thanks
-- 
Peter Hawkins

______________________________________________________________
Horizon Open Systems                   The Sidings Office Park
Mail : Peter.Hawkins@HOS.Horizon.ie    Antrim Road
Url  : http://www.hos.horizon.ie       Lisburn
Technical Details
Message-ID: <3621FD6E.D0213F03@hos.horizon.ie>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,f440fe083c1ad20c,start
X-Google-Attributes: gid111d45,public
From: Peter Hawkins <Peter.Hawkins@hos.horizon.ie>
Subject: Can anyone help with a problem on Cursors?
Date: 1998/10/12
Message-ID: <3621FD6E.D0213F03@hos.horizon.ie>
X-Deja-AN: 400232346
Content-Transfer-Encoding: 7bit
Organization: Horizon Open Systems, Northern Ireland
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing