Login  Register

close window without selecting first

Posted by jvander on Mar 27, 2007; 8:21pm
URL: http://imagej.273.s1.nabble.com/close-window-without-selecting-first-tp3699945.html

I am a long time user of ImageJ but my plug-in programming skills are rudimentary.  I typically
simply record a macro and convert to plug-in and dabble a bit with the details.

I am trying to close an image window without first selecting it.  Let's say I have two image windows
open named "image1" and "image2"

If the focus of attention is on image1 and I want to close image2 I do it as follows:

IJ.selectWindow("image2");
IJ.run("Close");

That works, but I'd prefer to do it in one command so that the focus stays on image1.

I guessed at

IJ.closeWindow("image2") among other things but have not figured it out yet.  Suggestions?

thanks

Joe vanderGracht