Nifty gui: panel background image vs image


is there any significant difference between using an image or a panel with backgroundImage in the nifty gui ?

What would you suggest to use and why ?

I use for example a ‘backgroundImage’ in my WindowBuilder, like this:


panel(new PanelBuilder(“winOC_Element”) {{


controller(new OperatorControl());

control(new WindowBuilder(“winOperatorControl”, “Operator”) {{



and also in my java class controller I can change this background image, with some code, like this: (this is the backgroundImage for a button, but I guess it is the same for a windowBuilder, because both are ‘elements’


screen.findElementByName(nameButton).getRenderer(ImageRenderer.class).setImage(nifty.createImage(buttonActive, false));



I hope it helps you.

1 Like

If you are putting other things inside it, use a panel. If not, use an image :slight_smile: