Re: controlling size and location of Console window

Posted by Kenneth Sloan-2 on
URL: http://imagej.273.s1.nabble.com/controlling-size-and-location-of-Console-window-tp5020161p5020177.html

Ah...this may be the solution I need, this year.  Re-directing stderr (and stdout) to the Log window will work for me.

Thank you very much.


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On 27 Feb 2018, at 18:15 , John Hayes <[hidden email]> wrote:
>
> Hi Kenneth and Curtis,
>
> Sorry, I’m a bit confused, I was under the impression from this statement that Kenneth you were referring to the “Log” window in IJ1 as the “Console":
>> On Feb 26, 2018, at 9:14 PM, Kenneth Sloan <[hidden email]> wrote:
>>
>> Now, I just need to make sure that my customers have upgraded to ImageJ2.
> If that were the case, I believe the solution to your original comment can be implemented roughly as the following which just uses AWT in IJ1:
>
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import java.awt.*;
> import ij.plugin.*;
> import ij.plugin.frame.*;
> import ij.io.LogStream;
>
> public class My_Plugin implements PlugIn {
>
>        public void run(String arg) {
>           IJ.log("Test1");
>           LogStream.redirectSystem();
>           Frame log = WindowManager.getFrame("Log");
>           System.err.println("Hello World!");
>           log.setLocation(250,250);
>           IJ.log("Test2");
>        }
> }
>
> The ij.io.LogStream class can redirect stderr similar to the link I sent, and ij.IJ uses this with a TextWindow as I suggested. However, if you really were referring to the IJ2 Console window, obviously Curtis knows better about it. :)
>
> HTH,
> John
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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