我正在使用带有setText和getText的org.eclipse.swt.widgets.Combo。我正在做以下事情:
System.out.println("Set value = " + model.getType(); //This prints out the type.. i.e. "MyType"
myCombo.setText(model.getType());
System.out.println("myCombo = " + myCombo.getText()); //Prints an empty string
我正在进行eclipse插件开发,我在createControl mathod中实例化了Combo对象。如果您需要更多细节,请告诉我们。我只是不知道为什么setText实际上没有设置文本或getText没有检索值。
谢谢!