ArrayIndexOutOfBoundsException in JXL
i have the same problem
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 2
at jxl.read.biff.SheetImpl.getCell(SheetImpl.java:356 )
here is my code
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
String temp = c.getSelectedItem().toString();
String telephone = "" ,code = "",date1 = "",nom_medecin = "";
for (int i= 0;i<sheet.getRows();i++){
if (temp.equals(sheet.getCell(i,1).getContents())) {
telephone=sheet.getCell(i+1, 1).getContents();
System.out.println(telephone);}}
for (int j= 0;j<sheet2.getRows();j++){
if (telephone.equals(sheet2.getCell(1,j).getContents( ))) {
code=sheet2.getCell(j,0).getContents();
System.out.println(code);
date1=sheet2.getCell(j, 2).getContents();
System.out.println(date1);}}
for(int k=0;k<sheet1.getRows();k++){
if(code.equals(sheet1.getCell(k, 0).getContents())){
nom_medecin=sheet1.getCell(k, 3).getContents();
System.out.println(nom_medecin);}}
tab.ajouterLigne(new Object[]{temp,nom_medecin,date1});
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(tab);
f.setSize(500, 500);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
});
plz can someone help me
Re: ArrayIndexOutofBounds Exception on an Excel File
It's impossible to tell from that example where the exception is being thrown. Which line is #356? What does your spreadsheet look like?
Re: ArrayIndexOutofBounds Exception on an Excel File
i have a very big xls file 26808 line and 15 columns
Re: ArrayIndexOutOfBoundsException in JXL
Removed from http://www.java-forums.org/new-java/...xcel-file.html
Don't post to old dead threads and don't hijack another poster's thread.
db