-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greg Brown wrote:
> I personally don't mind the anonymous inner class syntax:
> 
>     dialog.open(owner, new DialogCloseListener() {
>         @Override
>         public void dialogClosed(Dialog dialog, boolean modal) {
>             // Get selected option and act on it
>         }
>     });

After using a language like Scala (or even C#) the Java syntax feels
extremely verbose.  I've actually considered writing the UI part of my
app in Scala for this reason, but as all of the app's logic is already
written in Java, setting up a mixed Java/Scala project seems like more
work than dealing with callbacks in Java.

> 
> I actually think this reflects a pretty consistent design - you open the 
> dialog in response to one event (e.g. "button pressed"), and you handle the 
> dialog's result in response to another event (e.g. "dialog closed").

This is certainly true.  What I'd love is to be able to have the app
block until the "dialog closed" event is received, while keeping the
dialog responsive.  I now understand why it doesn't work though, and
very much appreciate your responses.

> 
>> Making the call to Dialog.open() from another thread doesn't have any effect.
> 
> Note that, as in Swing, multi-threaded access to UI elements is not 
> supported. All UI operations must be performed on the EDT.
> 
> Hope this helps,
> Greg
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktfHXEACgkQ5IyIbnMUeTuvUQCfdgy6lnERMQpagZ9iJgnmoBpU
yTIAn3dIkuqQDn+O9YiCftEaikq3NmGf
=Ows4
-----END PGP SIGNATURE-----

Reply via email to