【发布时间】:2015-06-04 16:38:29
【问题描述】:
我正在尝试根据从文件输入的字长创建一个 JTextField 数组。我似乎找不到从 String[] 转换为 JTextField[] 的方法。
//Splits the word chosen from word list into an array
JTextField[] wordAmount = new JTextField[word.length()];//Creates a JtextField for each letter
String[] items = word.split("");
String temp;
for (int j = 0; j < items.length; j ++) {
temp = items[j];
wordAmount[j].setText(temp);
}
【问题讨论】:
标签: java string jtextfield