0
我有几个对象,其中包含变量以供标准使用。在GWT我想要做以下事情:GWT从对象动态获取变量
public class myObject {
protected TextBox textbox1 = new TextBox();
protected TextBox textbox2 = new TextBox();
protected TextBox textbox3 = new TextBox();
protected TextBox textbox4 = new TextBox();
// pass name of field: textbox1, textbox2... etc.
public TextBox getMyTextbox(String fieldname) {
return this.... [fieldname];
}
}
该部分返回此...是我真的没有得到。任何帮助将受到欢迎。
,你会做什么,你真的不明白? :) 为什么要这么做? :)这是什么.... [fieldname]? – milan 2012-01-01 10:42:07
浪漫的问题? – 2012-01-01 19:24:49
@milan:功能我做getMyTextbox,但在我的脑海里,我不知道该怎么做,所以我不明白它;-)。 – MightyMouseTheSecond 2012-01-03 12:58:24