Custom interface

Hi everybody,

I’m trying to develop a custom interface for the users in order to allow users to give a name to a picture an select a type :

It’s almost perfect, but i would like to display the type just at the right of the name field (on the same line). Is there an easy way to do it ?

Thank you for your help,

Unfortunately via GenericDialog (or GenericDialogPlus) this will not be possible.

You’d have to implement your own Swing layout (unless someone would be so kind as to correct me).

Simplest I’d suggest is maybe use AddMessage() to add the type after each ‘Micro #’ line, though it might become rather long that way…


1 Like


Have you checked out Script Parameters?! That might be the most straightforward, simple solution? There is a widget example available in ImageJ/Fiji you can take a look at: Open the Script Editor and then it’s Templates > Intro > Widgets (there are examples in javascript and beanshell).

eta :slight_smile:

1 Like

Thanks everybody for your answer.
Sadly i’m thinking too that is not impossible with the macro language :disappointed_relieved:
I tried with the script parameters and the templates but i met the same problem !

I will try to find an other idea for my interface, thank you for your help :slight_smile:

Hi @etadobson, I stumbled into this thread and tried these templates you refer to. The javascript runs fine, but the beanshell template gives me an error. I don’t really need this template anyways, but maybe it is something to look into. I don’t use beanshell or javascript at all personally.

Thanks for spotting this, the beanshell example was broken since this commit by @ctrueden that introduced a license header, which was incompatible with the old style parameter syntax that required it to be at the very beginning of the script:

I filed a pull request to fix it:

1 Like


Thanks for the heads-up. That error is occurring because there are comments before the Script Parameters - so if you delete those leading comments… the code runs just fine.

I’ll be sure to fix this ASAP.

eta :slight_smile:

Not anymore with the new parameter syntax (#@ String etc…). See my pull request :wink:

1 Like


Thanks! Just saw that… :wink: You are way more on-top of things @imagejan

eta :slight_smile:

Argh, that was an accident. The script templates are not supposed to have those headers.

Fixed in scijava/scripting-beanshell@d344295b.

Edit: I also merged the PR. Thanks @imagejan.