Login  Register

Re: Potential solution for conversion from AWT to Swing

Posted by Raymond Martin-2 on Dec 05, 2009; 7:56am
URL: http://imagej.273.s1.nabble.com/ImageJ-development-involvement-contributions-tp3690030p3690081.html

Hi Ignacio,

> AWT-Swing coexistence is possible in the latest versions of Java, although
> it has some problems on some operative systems.
>
> If you have a look at the SIOX plugin (
> http://pacific.mpi-cbg.de/wiki/index.php/SIOX) you will see an example.
> Everything but the ImageWindow is a Swing component. If you try to run it
>  in a Linux machine, depending on the Compiz, some of the components will
>  be repainted correctly and some will not.

Okay, had a look and got it to run in my ImageJ version. I am working from
the 1.43l distribution version, so it had a bug that prevented it from running
initially. That is probably due to the plugin being new. So it won't load into
older stable distributed versions I believe.

In running that plugin I have discovered a typical problem that occurs in
Java GUI applications, that of the GUI blocking during long running processes.
I have solved this in other GUI applications I work on by using a specific
threading library, Foxtrot(BSD license), that enables the use of both
synchronous and asynchronous threads in flexible ways. SwingWorker can also be
used to prevent the GUI freeze, but is not as flexible (license?).

Would adding this dependency be acceptable for the problem it solves?

Other than that, I have not run into any serious problems converting to
Swing yet. Since the potential for problems is believed to rest with
supporting plugins, would ask others to please point out, if they can, exactly
which plugins gave problems in past efforts to do what I am attempting.

Regards,

Raymond