🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

long jobs, repainting, and cursor mgmt

#12363
From: William Glocker
Date: Thu, 14 Jan 1999 00:00
36 lines
2044 bytes
Hello,

I have an app with a JFrame-based  window and some JDialog-based
pop-ups.  Several types of long jobs can be started from buttons or pull
down menus.  Most of the jobs require one or more pop ups to confirm
actions, etc.

I'm using a callback scheme where the long job is broken into several
functions so that it can do some work, get info through a pop up, do
some more work, get info through a pop up, etc.  Each time the function
registers a callback with the pop up class, so that the next function in
the chain gets called when the user clicks OK on the pop up.

Despite the dispose() call in the OK button click event handler, the pop
up stays put on screen until the job finishes.  Further, the main window
never repaints if other apps are dragged across it - until the job
finishes.  I thought that putting the chain of function and pop up
window calls in a separate thread would free the window manager to
repaint, but it has no apparent affect.

The use of a separate thread has complicated managing the appearance of
the cursor too.  I'd like to have the "hourglass" cursor on during these
long runs.  But it appears that setCursor() only works in the main
thread, which will be tough to manage when the work is in a separate
thread...

This seems like the type of thing that would come up a lot - so there
must be a way to make this work.  Can anyone enlighten me?

Thanks,
Bill

--
William P. Glocker
Voice: 719-598-6854
email: bill.glocker@bigfoot.com
Technical Details
Message-ID: <369E31E2.51EE54DC@bigfoot.com>
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,3339ffd3981ba964,start
X-Google-Attributes: gid111d45,public
From: William Glocker <bill.glocker@bigfoot.com>
Subject: long jobs, repainting, and cursor mgmt
Date: 1999/01/14
Message-ID: <369E31E2.51EE54DC@bigfoot.com>
X-Deja-AN: 432614337
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing