0
如何將語句添加到actionPerformed以調用mkList並將結果存儲在新變量LinkedList aList中。如何將語句添加到actionPerformed來調用LinkedList並將結果存儲在新變量中
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