• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stange question!

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,everybody,
I have a stange question in my program.
When I have no flight information displayed in the result table and use key TAB in the JTable,
the console prints out the following exceptions:
java.lang.ArrayIndexOutOfBoundsException: 2
at suncertify.client.FlightTableModel.getValueAt(Unknown Source)
at javax.swing.JTable.getValueAt(JTable.java:1760)
at suncertify.client.FBNFrame$FlightSelectListener.valueChanged(Unknown
Source)
....

But if I use mouse on the JTable, this doesn't happen.
Would someone like to help me with this?
If I submit my assignment without correcting this
problem, what is the result of my score(ie, it is important enough)?
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make your cells non editable. I am not sure if your design allows this restriction. You will not get the exception if you don't try to change the value in the cell.
 
Jason Chen
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't implement the isEditable() in the FlightTableModel whiche extends AbstractTableModel
so I think the cell is not editable.
 
reply
    Bookmark Topic Watch Topic
  • New Topic