beginners doubt to get plugin to the gui sub menu

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

beginners doubt to get plugin to the gui sub menu

donny008
hello all

i have just started to work with imagej and am trying to develop plugins.
from the tutorials for writing plug ins i get to know that i can also get
the plugins integrated into the imagej GUI by having an underscore with the
class name. i also see the same with the example plugins Filer Plugin and
Plugin Frame. but when i try the same with a java hello world program i am
not able to see it under the plugin submenu. of course its the example code
which is as follows and saved as Hello_World.java in the plugin folder

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

public class Hello_World implements PlugIn {

    public void run(String arg) {
        IJ.showMessage("My_Plugin","Hello world!");
    }

}


could someone help me with my simple doubt. i am sure its the most basic
doubt

thank you for the help
--
Donny George
Reply | Threaded
Open this post in threaded view
|

Re: beginners doubt to get plugin to the gui sub menu

Michael Schmid
Hi Donny George,

you see it in the plugins menu only after it has been compiled (so  
there is a .class file) and ImageJ has been restarted.

Also, in Edit>Options>Miscellaneous Options, there is a checkbox  
"Move isolated Plugins to Misc menu". When active, you will find it  
in Plugins>Misc, not in the Plugins menu itself. This is to avoid the  
Plugins Menus becoming too long is there are many packages in it.

Michael
________________________________________________________________

On 7 Apr 2009, at 17:27, Donny George wrote:

> hello all
>
> i have just started to work with imagej and am trying to develop  
> plugins.
> from the tutorials for writing plug ins i get to know that i can  
> also get
> the plugins integrated into the imagej GUI by having an underscore  
> with the
> class name. i also see the same with the example plugins Filer  
> Plugin and
> Plugin Frame. but when i try the same with a java hello world  
> program i am
> not able to see it under the plugin submenu. of course its the  
> example code
> which is as follows and saved as Hello_World.java in the plugin folder
>
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import java.awt.*;
> import ij.plugin.*;
>
> public class Hello_World implements PlugIn {
>
>     public void run(String arg) {
>         IJ.showMessage("My_Plugin","Hello world!");
>     }
>
> }
>
>
> could someone help me with my simple doubt. i am sure its the most  
> basic
> doubt
>
> thank you for the help
> --
> Donny George
Reply | Threaded
Open this post in threaded view
|

Re: beginners doubt to get plugin to the gui sub menu

BenTupper
In reply to this post by donny008
Hi,

On Apr 7, 2009, at 11:27 AM, Donny George wrote:

> hello all
>
> i have just started to work with imagej and am trying to develop  
> plugins.
> from the tutorials for writing plug ins i get to know that i can  
> also get
> the plugins integrated into the imagej GUI by having an underscore  
> with the
> class name. i also see the same with the example plugins Filer  
> Plugin and
> Plugin Frame. but when i try the same with a java hello world  
> program i am
> not able to see it under the plugin submenu. of course its the  
> example code
> which is as follows and saved as Hello_World.java in the plugin folder
>
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import java.awt.*;
> import ij.plugin.*;
>
> public class Hello_World implements PlugIn {
>
>    public void run(String arg) {
>        IJ.showMessage("My_Plugin","Hello world!");
>    }
>
> }
>
>
> could someone help me with my simple doubt. i am sure its the most  
> basic
> doubt


You are very close!  Once you have successfully compiled and run the  
plugin (Plugins > Compile and run...) you need to update the menus.  
You can either (a) restart ImageJ or (b) use the Help>Update menus  
menu option.

Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|

Re: beginners doubt to get plugin to the gui sub menu

dscho
In reply to this post by donny008
Hi,

On Tue, 7 Apr 2009, Donny George wrote:

> i have just started to work with imagej and am trying to develop
> plugins. from the tutorials for writing plug ins i get to know that i
> can also get the plugins integrated into the imagej GUI by having an
> underscore with the class name. i also see the same with the example
> plugins Filer Plugin and Plugin Frame. but when i try the same with a
> java hello world program i am not able to see it under the plugin
> submenu. of course its the example code which is as follows and saved as
> Hello_World.java in the plugin folder
>
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import java.awt.*;
> import ij.plugin.*;
>
> public class Hello_World implements PlugIn {
>
>     public void run(String arg) {
>         IJ.showMessage("My_Plugin","Hello world!");
>     }
>
> }

That looks correct, and it works here.

Did you actually copy the .class file into the plugins/ folder?

Ciao,
Dscho