当我以下面代码片段中显示的方式创建对话框时,如何添加其他小部件(如 TextField)?
btnTest.addListener(new ChangeListener()
{
public void changed(ChangeEvent event, Actor actor)
{
new Dialog("Test Dialog", globals.skin, "dialog")
{
protected void result (Object object)
{
if (object.equals(true))
{
if (txtID.getText() != "")
{
globals.appState = AppState.INTRO;
}
}
}
}.text("Enter ID")
.button("Cancel", false)
.button("OK", true)
.show(stage);
}
});