• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stange question!

 
Jason Chen
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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)?
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic