Login  Register

Re: TextField in Fiji

Posted by AJBell on Oct 09, 2013; 10:25am
URL: http://imagej.273.s1.nabble.com/TextField-in-Fiji-tp5005091p5005097.html

Hi Johannes,

This code:

import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.frame.*;

public class Plugin_Frame extends PlugInFrame {

        public Plugin_Frame() {
                super("Plugin_Frame");
                TextField tf = new TextField();
                add(tf);
                pack();
                GUI.center(this);
                setVisible(true);
        }

}

produces the following error

   File....\Plugin_Frame.java:12: cannot find symbol
   symbol  : method add(TextField)
   location: class Plugin_Frame
                add(tf);

But only in Fiji - it works fine with ImageJ.

Andrew


Johannes Schindelin wrote
Hi Andrew,

On Wed, 9 Oct 2013, AJBell wrote:

> I've started using Fiji recently for plugin development and ran into a
> problem when updating a plugin that works fine in ImageJ.
>
> The bit which seems to be the problem are a couple of TextFields in a
> plugin frame. They can be constructed, but the error appears why I try
> to add them to a panel or the frame directly, i.e.
>
> TextField tf = new TextField();
> add(tf);
>
> or
>
> TextField tf = new TextField();
> panel.add(tf);
>
> Both of which fail, but only in Fiji, not ImageJ. Has anyone come across
> this before and know of a solution?

It would be helpful to know how they fail, i.e. what the error messages
are. Remember, things usually succeed in only one way, but they can fail
in million ways.

Ciao,
Johannes

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