如何向 actionPerformed 添加语句以调用 mkList 并将结果存储在新变量 LinkedList aList 中。
public void actionPerformed(ActionEvent event) {
if (event.getSource() == reading) {
String s = txt1.getText();
String delims = expression.getText();
String[] anArray = s.split(delims);
result.setText("");
print(anArray);
}
LinkedList<String> mkList;
LinkedList<String> aList = new LinkedList<String>();
} // actionPerformed
public LinkedList<String> mkList(String[] sa) {
LinkedList<String> st = new LinkedList<String>();
for (int i = 0; i < sa.length && sa[i] != null; i++)
st.add(sa[i] + "\n");
return st;
} // mkList