Title: Message
You should not replace the whole GUI with the single panel. Just create a lightweight class e.g. GlassPanel derived from Component, set its size to the main container's size and add it into the main container at index 0. This will block all user interaction with the application. When transmission is over just remove the GlassPanel from main container.
 
In the GlassPanel.paint()  you may draw whatever you want on top of all GUI. For example, g.fillRect(), g.drawString() and even to g.drawImage() animated gif.  Also, while GlassPanel is visible change the arrow cursor to wait cursor.
 
-mg
 
-----Original Message-----
From: mzperx [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 8:59 AM
To: jdjlist
Subject: [jdjlist] Re: modal,but not dialog

Thank you for the quick response.

Do you mean I should replace the whole GUI with a panel with a string during communication and then change it back?

If so, it wouldn�t make our client happy, they want the data (e.g.: search criteria) visible while communicating. L

In the meantime, I started to make a state-aware implementation test for the GUI components, if all else fails.

 

Thank you again,

Peter

-----Eredeti �zenet-----
Felad�: U. Penski [mailto:penski@uumail.de]
K�ldve: 2003. november 11. 14:03
C�mzett: jdjlist
T�rgy: [jdjlist] Re: modal,but not dialog

 

Hi,

a short answer (I'm on the move) :

look at "MSDEV\Samples\Sun\CardTest" of MS-JDK 1.0 (or newer).

There the controls are put into a "panel" (class Panel). You could remove the panel as long as necessary - showing e.g. a g.drawString("busy communicating...",x,y); at its place

 

sincerely,

U. Penski

----- Original Message -----

From: mzperx

To: jdjlist

Sent: Tuesday, November 11, 2003 7:26 AM

Subject: [jdjlist] modal,but not dialog

 

Hi,

 

I have a gui-related problem with a legacy-application, and I ask for your advice.

 

I have an applet-client, where client-server comm. might take pretty long.

Now, the communication doesn�t run on a separate (worker-) thread, but on the main one, which makes unwanted clicks on the buttons possible, without the user knowing it, as gui is not updated till the comm. ends, because they are all on the main event dispatching thread. As the gui isn�t updated, the user might think, nothing has happened, and clicks again.And again.

Unfortunately I am not allowed to disable all buttons, fields, etc. as state-handling is not implemented, so after the comm. ends I don�t know in which state I should update the gui automatically.

 

What I was thinking about as a solution to prevent subsequent actions easily is to throw up a modal dialog telling the user that the communication has started.

Since it would be modal, user would not be able to click on anything else till the modal dialog is open. Then, when comm. ends, it would make the dialog disappear.

The problem is the natural way of working of the modal dialog: till it�s closed, code execution halted.

 

Do you have any idea how could I throw up a �modal something� which is not a dialog  or achive the goal, so that:

1. gui components should not be disabled and

2. user would not be able to send actions (clicks, selection, whatever) and

3. inform user of the running communication.

 

To summarize it, I think it would be a temporarily non-responsive gui.

We use jdk 1.3.1, so indeterminate progress bars and monitors are not available and as far as I know, they are not modal anyway.

 

Thanks for the help in advance,

 

Peter

 

---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED]

---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED] ---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED]

Reply via email to