Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default 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

  2. #2
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default 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?

  3. #3
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: ArrayIndexOutofBounds Exception on an Excel File

    i have a very big xls file 26808 line and 15 columns

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: ArrayIndexOutOfBoundsException in JXL

    Removed from ArrayIndexOutofBounds Exception on an Excel File

    Don't post to old dead threads and don't hijack another poster's thread.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. what is ArrayIndexOutOfBoundsException ???
    By gauravmanral in forum New To Java
    Replies: 6
    Last Post: 07-16-2011, 08:45 AM
  2. Replies: 3
    Last Post: 04-10-2011, 09:28 PM
  3. ArrayIndexOutOfBoundsException
    By er1c550n20 in forum New To Java
    Replies: 2
    Last Post: 04-07-2010, 07:50 PM
  4. ArrayIndexOutOfBoundsException
    By Corey in forum New To Java
    Replies: 5
    Last Post: 02-02-2010, 02:25 AM
  5. ArrayIndexOutofBoundsException help
    By filly444 in forum New To Java
    Replies: 9
    Last Post: 09-03-2008, 06:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •