[ImageJ-devel] Displaying into Swing/JFrame

Curtis Rueden ctrueden at wisc.edu
Mon Oct 5 12:50:05 CDT 2015


Hi Andy,

> I am trying to use ImageJ2 as a tool in a larger application which is
> built using Swing windows.

The ImageJ2 API is built to be UI agnostic, so you can use it with Swing,
SWT, or any other widget toolkit of your choice.

> If I use and IJ.ImageJ object it displays but not in my JFrame.

The class ij.ImageJ is part of ImageJ1. More generally: package prefix ij
corresponds to IJ1, whereas package prefixes net.imagej and org.scijava
correspond to ImageJ2. The ImageJ1 classes are written to use Java AWT, and
have many limitations when it comes to their use with other toolkits and
environments.

> My question:  Is there a message thread that covers this I can read?
> Does someone have a sample app or suggestion they care to share?

There is not a lot of explicit documentation about the structure yet. The
closest is this page:

* http://imagej.net/Modularity

Which is not very fleshed out.

> I would not mind just running the ImageJ app and having the output
> sent to my JFrame, if this is an option already built in to ImageJ.

If you are more specific about what you are trying to achieve, and can
share some code, that would help in giving you more concrete suggestions
about how to proceed.

Regards,
Curtis

On Mon, Sep 14, 2015 at 4:04 PM, Andrew J Askey <AJAskey at raytheon.com>
wrote:

> Hi. I am trying to use ImageJ2 as a tool in a larger application which is
> built using Swing windows.  I want to display the windows from ImageJ
> inside of one of my application JFrame windows (could be some other
> component if that works better).  I have had some luck creating an
> ImageCanvas and adding to my layout.  This opens the ImagePlus object and
> appears to read the mouse correctly.  But any drawing does not show up.  If
> I use and IJ.ImageJ object it displays but not in my JFrame.  Funny thing
> is that I can draw on my window frame and it shows up in the standard
> ImageJ window (so reads/input are mapped correctly but writes/out are not).
>
> My question:  Is there a message thread that covers this I can read?  Does
> someone have a sample app or suggestion they care to share?
>
> For a simpler approach, I would not mind just running the ImageJ app and
> having the output sent to my JFrame, if this is an option already built in
> to ImageJ.
>
> Thanks.
>
> *Andy Askey*
> Software Engineer - RME
> Intelligence, Information and Services
> * Raytheon Company*
> +1 720.858.4183   (office)
> *AJAskey at raytheon.com* <AJAskey at raytheon.com>
>
> *RSpace Profile*
> <http://rspace.app.ray.com/profiles/html/profileView.do?uid=72577>
>
>
>
> [image: Raytheon Sustainability]
> *This message contains information that may be confidential and
> privileged. Unless you are the addressee (or authorized to receive mail for
> the addressee), you should not use, copy or disclose to anyone this message
> or any information contained in this message. If you have received this
> message in error, please so advise the sender by reply e-mail and delete
> this message. Thank you for your cooperation.*
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20151005/a163f2fe/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4310 bytes
Desc: not available
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20151005/a163f2fe/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 35128 bytes
Desc: not available
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20151005/a163f2fe/attachment-0003.gif>


More information about the ImageJ-devel mailing list