关键代码如下:
for(int j=0;j<=100;j++){
Text text=new Text(shell, SWT.NONE);
text.setText("");
}用for循环生成100个文本框 ,如果用户在某一个文本框中输入了某个值 ,如何用 text.getText();方法得到里面内容text.getText();的text要怎么写才对?
如果把这100个text重新扫描一下,然后把值存入数组,这是一个解决办法嘛?
for(int j=0;j<=100;j++){
Text text=new Text(shell, SWT.NONE);
text.setText("");
}用for循环生成100个文本框 ,如果用户在某一个文本框中输入了某个值 ,如何用 text.getText();方法得到里面内容text.getText();的text要怎么写才对?
如果把这100个text重新扫描一下,然后把值存入数组,这是一个解决办法嘛?
for(int j=0;j<=100;j++){
text[j]=new Text(shell, SWT.NONE);
text[j].setText("");
}int[] result = new int[]{100};
for (int j=0;j<=100;j++) {
result[j] = text[j].getText();
}