public class MailInfo{
static ArrayList<String> al = new ArrayList<String>();
public static ArrayList<String> getArrList() {
return al;
}
protected void locateFile() throws BiffException, IOException {
FileChooser chooser = new FileChooser();
chooser.setTitle("Open File");
File file = chooser.showOpenDialog(new Stage());
Workbook workbook = Workbook.getWorkbook(file);
Sheet sheet = workbook.getSheet(0);
int endIdx = sheet.getColumn(0).length-1;
for(int i=0; i <= endIdx; i++){
String email = sheet.getCell(0, i).getContents() ;
al.add(email);
}
workbook.close();
}
}
----------------------------------------
protected void SendMail(ActionEvent event) throws Exception {
ArrayList<String> al = MailInfo.getArrList();
for(int i=0; i < al.size(); i++ ){
String sm = al.get(i);
MailInfo.SendMail(sm);
}
}
여기서 MailInfo.getArrList()를
static을 사용해서 공유하는 방법 말고
다른 방법은 없나여?
c++에서는 MailInfo *mi 이렇게 공유할 수 있는것으로아는데
자바는 잘모르겠네여