Plugins can implement the ImageListener interface to detect when
image windows are opened or closed. There is an example at <http://
rsb.info.nih.gov/ij/plugins/image-listener.html>.
-wayne
On Aug 18, 2007, at 12:12 PM, Piotr Wendykier wrote:
> Hello,
>
> I'm trying to add an ActionListener to the ImageJ menu, but my code
> does not work:
>
> MenuBar menuBar = IJ.getInstance().getMenuBar();
> Menu menu = menuBar.getMenu(0);
> menu.addActionListener(new ActionListener() {
> public void actionPerformed(ActionEvent e) {
> //TODO
> }
> });
>
> It looks like the only ActionListener that is added to the menu is
> ij.ImageJ.
> In my plugin I want to respond to ImageJ menu events (in particular, I
> need to know when new window was opened).
>
> Thanks,
>
> Piotr Wendykier