Login  Register

Re: Presentation and one question about OpenDialog boxes

Posted by Fernando Sales on Jan 30, 2008; 5:05pm
URL: http://imagej.273.s1.nabble.com/Presentation-and-one-question-about-OpenDialog-boxes-tp3697355p3697357.html

Wayne and Michael,

I've called a "new OpenDialog()" twice but, in the second time, the title
wasn't updated and the method openDialog.getFileName() returned an empty
String but the second image was opened correctly.
At the end, there is a piece of code which describes what i'm talking about.
Thanks for helping!

Fernando Sales


*****************************************************************************************

import ij.*;
import ij.process.*;
import ij.io.OpenDialog;
import ij.plugin.*;
import java.util.*;

public class VH_FrameAnalysis
    implements PlugIn {
  ImagePlus imps;

  public void run(String args) {

   OpenDialog preOpener = new OpenDialog("Select PRE-Interv. Frame",
OpenDialog.getLastDirectory());
   String preName = preOpener.getFileName();
   ij.IJ.open(preName);

   preOpener = new OpenDialog("Select POST-Interv. Frame",
OpenDialog.getLastDirectory());
   System.out.println(preName);
   OpenDialog postOpener = new OpenDialog("Select POST-Interv. Frame",
OpenDialog.getLastDirectory());
   String postName = postOpener.getFileName();
   System.out.println(postName);
   ij.IJ.open(postName);

 }

  void showAbout() {
    IJ.showMessage("Teste");
  }
}






On Jan 30, 2008 6:38 AM, Michael Schmid <[hidden email]> wrote:

> Hi Fernando,
>
> maybe the path that you have specified is not null when you
> create your second OpenDialog?
> BTW, you can't *call* an OpenDialog for the second time, you
> have to create a new OpenDialog.
>
> Michael
> ________________________________________________________________
>
> On 29 Jan 2008, at 23:43, Fernando Sales wrote:
>
> > Hello everybody!
> >
> > I'm Fernando Sales, this is my first time on this mailing list.
> > Currently, i'm from Brazil and now, IJ has been used by me for
> > intravascular
> > ultrasound image processing.
> > I had some problem to use the OpenDialog class. More specifically,
> > i ued it
> > to open a file and store this file's name.
> > But when i've called the OpenDialog for the second time, i've
> > opened the
> > second file but i couldn't store the second file's name.
> > Is there any restritions for the use of OpenDialog boxes?
> >
> > See you,
>