Unable to add element to scrollPanel programatically


There is a problem what I simply cannot solve and I am not sure whether I did a misake or there is a small bug in NiftyGui-s code.

The scenario is quite simple. I would like to add an element (a button for example) to a scrollPanel programatically but instead of appearing in the scrollPanel the button appears below the scrollPanel element.
Using XML works fine.

Here is a simple code:

import com.jme3.app.SimpleApplication;
import com.jme3.niftygui.NiftyJmeDisplay;
import com.jme3.renderer.RenderManager;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.controls.label.builder.LabelBuilder;
import de.lessvoid.nifty.elements.Element;

public class Main extends SimpleApplication {

Nifty nifty;

public static void main(String[] args) {
    Main app = new Main();

public void simpleInitApp() {

    NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(
    assetManager, inputManager, audioRenderer, guiViewPort);
    nifty = niftyDisplay.getNifty();
    nifty.fromXml("Interface/newNiftyGui.xml", "start");

    Element panel = nifty.getCurrentScreen().findElementByName("myListBox");
    (new LabelBuilder("Button_ID", "qwe")).build(nifty, nifty.getCurrentScreen(), panel);

public void simpleUpdate(float tpf) {
    //TODO: add update code

public void simpleRender(RenderManager rm) {
    //TODO: add render code


and the corresponting XML:

<?xml version=“1.0” encoding=“UTF-8”?>
<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>
<useStyles filename=“nifty-default-styles.xml” />
<useControls filename=“nifty-default-controls.xml” />

&lt;style id="my-scrollpanel#scrollpanel"&gt;
    &lt;attributes backgroundColor="#ffff"&gt;&lt;/attributes&gt;
    &lt;effect overlay="true"&gt;
        &lt;!-- this is the part that causes the problem :/ --&gt;
        &lt;!--        &lt;onActive name="blendMode" blendMode="multiply" post="true" /&gt;  --&gt;
        &lt;onActive name="imageOverlay" filename="blackborder.png" imageMode="resize:1,30,1,1,1,30,1,1,1,30,1,1" post="true"&gt;&lt;/onActive&gt;
&lt;style id="my-scrollpanel#bottom-right"&gt;
    &lt;attributes width="23px" height="23px"&gt;&lt;/attributes&gt;

&lt;screen id="start"&gt;
    &lt;layer id="layer" childLayout="center"&gt;
        &lt;panel id="panel" align="center" childLayout="center"&gt;
            &lt;control id="myListBox" name="scrollPanel" childLayout="vertical" style="my-scrollpanel"&gt;


(There is a style definition in the xml because another bug in Nifty-s code… just ignore it.)

Anyone can reproduce the problem?

Any comment is greaty appreciated!
Thank you