if (patarray.length > 0) {  for (int j = 0; j < patarray.length; j++) { myModel.list.add(patarray[j]); } } else {  if  (table.getSelectedRowCount() == 0) myModel.list.add(firstpat); else myModel.list.add(table.getSelectedRow(), firstpat); } } myModel.fireTableDataChanged(); changed = true;
for (int j = 0; j < patarray.length; j++) { if (table.getSelectedRowCount() == 0) myModel.addPatch(patarray[j]); else myModel.setPatchAt(patarray[j], table.getSelectedRow()); } }  myModel.fireTableDataChanged(); changed = true;
    public void importPatch(File file) throws IOException, FileNotFoundException {        FileInputStream fileIn = new FileInputStream(file);        byte [] buffer = new byte [(int) file.length()];        fileIn.read(buffer);        fileIn.close();        int offset = 0;        while (offset < buffer.length - 1) {            // There is still something unprocessed in the file            Patch firstpat = new Patch(buffer, offset);            offset += firstpat.sysex.length;            //ErrorMsg.reportStatus("Buffer length:" + buffer.length + " Patch Lenght: " + firstpat.sysex.length);            Patch[] patarray = firstpat.dissect();            if (patarray.length > 0) {		// Conversion was sucessfull, we have at least one converted patch                for (int j = 0; j < patarray.length; j++) {                    myModel.list.add(patarray[j]); // add all converted patches                }            } else {		// No conversion. Try just the original patch....		if  (table.getSelectedRowCount() == 0)		    myModel.list.add(firstpat);		else		    myModel.list.add(table.getSelectedRow(), firstpat);	    }	}	myModel.fireTableDataChanged();	changed = true;	//statusBar.setText(myModel.getRowCount() + " Patches");    }