求解一个关于SWT的Text的StackOverflowError错误原因
java吧
全部回复
仅看楼主
level 13
xiao78050576 楼主
public class TextTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(150,100);
final Text text = new Text(shell,SWT.SINGLE | SWT.BORDER);
text.setBounds(40, 20, 70, 20);
text.addModifyListener(new ModifyListener(){
@Override
public void modifyText(ModifyEvent e) {
text.setText("g");//StackOverflowError
}});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}

2011年07月06日 08点07分 1
level 13
xiao78050576 楼主
触发了时间,在设值的时候就会出问题
2011年07月06日 08点07分 2
level 13
xiao78050576 楼主
2011年07月06日 08点07分 3
level 13
xiao78050576 楼主
[揉脸]偶尔顶下,求解
2011年07月06日 12点07分 4
1