Login  Register

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

Posted by Michael Schmid on Mar 19, 2010; 9:50am
URL: http://imagej.273.s1.nabble.com/Need-to-close-the-result-table-from-my-java-application-tp3687988p3687990.html

Hi Bob,

the TextWindow class has a close() method. So you probably need  
something like the following:

   Frame frame = WindowManager.getFrame("Results");
   if (frame instanceof TextWindow) {
     TextWindow textWindow = (TextWindow)Frame;
     textWindow.close();
   } else {
     SOME ERROR HANDLING (either frame=null or there is a non-
TextWindow window named 'Results')
   }

TextWindow.close should take care of the rest: If the title is  
"Results", it puts the results counter to zero and clears the  
textPanel associated with the results.

Michael
________________________________________________________________

On 18 Mar 2010, at 16:34, Bob Loushin wrote:

> @Michael Schmid  Yes, close() would be a great solution, but it  
> doesn't exist, at least at the level I'm trying to get at it (Frame  
> class).