Displaying into Swing/JFrame

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Displaying into Swing/JFrame

Andrew J Askey
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@...

RSpace Profile



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
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel

Reply | Threaded
Open this post in threaded view
|

Re: Displaying into Swing/JFrame

Curtis Rueden
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:


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 <[hidden email]> 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

<a href="tel:%2B1%C2%A0720.858.4183" value="+17208584183" target="_blank">+1 720.858.4183   (office)
[hidden email]

RSpace Profile



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
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel