for (int i = 0; i < openFiles.length; i++) { File openFile = openFiles[i]; invXML = ""; try { BufferedReader br = new BufferedReader(new FileReader(openFile));  String nextLine = br.readLine(); while (nextLine != null) { invXML = invXML + nextLine + "\n"; nextLine = br.readLine(); } br.close(); } catch (IOException ioe) { throw new RuntimeException(ioe); }  inventory = parser.parseString(invXML); fm.addItem(inventory, invXML); } try { SwingUtilities.invokeAndWait(new FlushXMLToScreenRunnable(invXML, openFiles, fm)); } catch (Exception e) { e.printStackTrace(); } fileChooser.setMultiSelectionEnabled(false); }
    public void doOpenXML(File[] openFiles) {	InventoryFileManager fm=null;	String invXML="";	try {	    SwingUtilities.invokeAndWait(new TaskStartRunnable(this));	}	catch(Exception e) {	    e.printStackTrace();	}	if(openFiles.length > 0) {	    if(dataSource instanceof InventoryFileManager)  {		fm = (InventoryFileManager) dataSource;	    }	    else {		fm = new InventoryFileManager(this);		dataSource = fm;	    }	}	for(int i=0; i < openFiles.length; i++) {	    File openFile = openFiles[i];	    invXML="";	    try{		BufferedReader br = new BufferedReader(new FileReader(openFile));				String nextLine = br.readLine();		while(nextLine != null) {		    invXML = invXML + nextLine + "\n";		    nextLine = br.readLine();		}		br.close();	    }	    catch(IOException ioe) {		throw new RuntimeException(ioe);	    }	    		inventory = parser.parseString(invXML);		fm.addItem(inventory,invXML);	}	try {	    SwingUtilities.invokeAndWait(new FlushXMLToScreenRunnable(invXML,openFiles,fm));	}	catch(Exception e) {	    e.printStackTrace();	}	fileChooser.setMultiSelectionEnabled(false);    }