Potential Focus issue

Not sure, but…



If you create a panel with multiple textfields. Set focus on the first and TAB through them:



It all seems to work fine, until you tab past the last one. At this point, all fields show focus and TAB or SHIFT+TAB does nothing. I did update to the latest styles, so I am fairly sure this is not another one of those issues, but… I can’t verify if this is an issue or not without someone else seeing if it happens for them as well.



Thanks in advance!



P.S. All elements are being created using either Creators or Builders. If this matters.

This example works for me with JME3_2011-02-27:



[java]package jme3test.niftygui;



import com.jme3.app.SimpleApplication;

import com.jme3.material.Material;

import com.jme3.math.Vector3f;

import com.jme3.niftygui.NiftyJmeDisplay;

import com.jme3.scene.Geometry;

import com.jme3.scene.shape.Box;



import de.lessvoid.nifty.Nifty;

import de.lessvoid.nifty.builder.LayerBuilder;

import de.lessvoid.nifty.builder.PanelBuilder;

import de.lessvoid.nifty.builder.ScreenBuilder;

import de.lessvoid.nifty.controls.textfield.builder.TextFieldBuilder;

import de.lessvoid.nifty.screen.Screen;



public class TestTextField extends SimpleApplication {

private Nifty nifty;



public static void main(String[] args){

TestTextField app = new TestTextField();

app.setPauseOnLostFocus(false);

app.start();

}



public void simpleInitApp() {

Box b = new Box(Vector3f.ZERO, 1, 1, 1);

Geometry geom = new Geometry("Box", b);

Material mat = new Material(assetManager, "Common/MatDefs/Misc/SimpleTextured.j3md");

mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));

geom.setMaterial(mat);

rootNode.attachChild(geom);



NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);

nifty = niftyDisplay.getNifty();

nifty.loadStyleFile("nifty-default-styles.xml");

nifty.loadControlFile("nifty-default-controls.xml");



Screen screen = new ScreenBuilder("start") {{

layer(new LayerBuilder("dialogLayer") {{

childLayoutCenter();

panel(new PanelBuilder("dialog-parent"){{

height("200px");

width("200px");

align(Align.Center);

valign(VAlign.Center);

childLayoutVertical();

control(new TextFieldBuilder("a") {{

width("100px");

}});

control(new TextFieldBuilder("b") {{

width("100px");

}});

control(new TextFieldBuilder("c") {{

width("100px");

}});

control(new TextFieldBuilder("d") {{

width("100px");

}});

}});

}});

}}.build(nifty);

nifty.addScreen("start", screen);

nifty.gotoScreen("start");



nifty.getScreen("start").findElementByName("a").setFocus();



guiViewPort.addProcessor(niftyDisplay);

flyCam.setEnabled(false);

}

}[/java]



Any chance that you can provide an example like this to reproduce this issue?