Re: ImageJ Applet problem running my code and opening images

Posted by Rasband, Wayne (NIH/NIMH) [E] on
URL: http://imagej.273.s1.nabble.com/ImageJ-Applet-problem-running-my-code-and-opening-images-tp5000786p5000791.html

On Nov 13, 2012, at 7:21 AM, thehobbit wrote:

> Hello everyone,
>
> I'm trying to run my JAVA code as an applet using also ImageJ API, but it
> doesn't work.

The ImageJ 1.47f daily build fixes a v1.46f regression that caused the ImageJ class (when running as an applet) to throw an exception. This caused code in ImageJApplet that opened images to be ignored.

-wayne

> I even have problem showing a simple image. Here is an example:
>
> public class ImageJApplet extends Applet {
>
> /** Starts ImageJ if it's not already running. */
>    public void init() {
>     ImageJ ij = IJ.getInstance();
>     if (ij==null || (ij!=null && !ij.isShowing()))
> new ImageJ(this);
>
>   ImagePlus imp = new
> ImagePlus("http://osasapere.it/wp-content/uploads/2011/06/dna_500.jpg");
>
> imp.show();
>
>    }
>
>    public void destroy() {
>     ImageJ ij = IJ.getInstance();
>     if (ij!=null) ij.quit();
>    }
>
> }
>
> The main istance of imageJ starts, but the image does not start at all.
> I have more code to run as an applet, like:
>
>            SelectionTool st = new SelectionTool();
>            st.run("");
>
> This code, for example, shows some JAVA button I made which run some imageJ
> API and so on, and it works when I run it in Eclipse, but fails to start as
> an applet.
>
> A "funny" thing I noticed is this: when I try to use this applet
> http://rsb.info.nih.gov/ij/applet2/ it does not show the images passed as
> parameters as it says, but starts only the main instance of imageJ.
> So, I don't know if the problem is my browser; I use Chrome.
>
> Can someone help me please?
>
> Thank you in advance
>
>
>
> --
> View this message in context: http://imagej.1557.n6.nabble.com/ImageJ-Applet-problem-running-my-code-and-opening-images-tp5000786.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html