Login  Register

Re: Need to close the result table from my java application

Posted by EHB2010 on Mar 16, 2010; 6:38pm
URL: http://imagej.273.s1.nabble.com/Need-to-close-the-result-table-from-my-java-application-tp3687988p3688007.html

I'm sorry that was bad advice. I've just had a quick look at the source code for results tables. It's actually very simple- this plugin makes invisible the results window on my system:

import ij.WindowManager;
import ij.plugin.PlugIn;
import java.awt.*;
 
public class TestPlugin_  implements PlugIn {
       
        public void run(String arg) {
               
                Frame[] arrayOfFrames = WindowManager.getNonImageWindows();
                for (int i = 0 ; i < arrayOfFrames.length ; ++i) {
                        String localName = arrayOfFrames[i].getTitle();
                        if ( localName.equalsIgnoreCase("Results")){
                                arrayOfFrames[i].setVisible(false);
                        }
                }
        }
}

BW