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
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();
}
}



