Re: ArrayIndexOutOfBounds Exception in DefaultTableModel
From: Andrew McDonagh (news_at_andrewcdonagh.f2s.com)
Date: 01/04/05
- Next message: Flex: "Sun MQ 3.5 example"
- Previous message: Rohan Chaudhari via JavaKB.com: "ArrayIndexOutOfBounds Exception in DefaultTableModel"
- In reply to: Rohan Chaudhari via JavaKB.com: "ArrayIndexOutOfBounds Exception in DefaultTableModel"
- Next in thread: Michael Sashnikov via JavaKB.com: "Re: ArrayIndexOutOfBounds Exception in DefaultTableModel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 Jan 2005 08:44:17 +0000
Rohan Chaudhari via JavaKB.com wrote:
> Hi,
>
snipped exception...
> Code for clearing the table results:
>
> public void removeAll()
> {
> int rows = getRowCount();
> for (int i = 0; i < rows; i++)
> removeRow(0);
> }
................../\
you are always removing row 0 - i think you meant to remove row(i);
>
> I found that : if I select a row other than the first one and try to remove a row using removeRow(0), a valueChanged() event of DefaultListSelectionModel is getting fired. However, this event is not getting fired when I select the first row and then remove the row.
>
> If anybody has any idea about this, kindly help me understand this behaviour.
>
> Thanking you in anticipation
>
- Next message: Flex: "Sun MQ 3.5 example"
- Previous message: Rohan Chaudhari via JavaKB.com: "ArrayIndexOutOfBounds Exception in DefaultTableModel"
- In reply to: Rohan Chaudhari via JavaKB.com: "ArrayIndexOutOfBounds Exception in DefaultTableModel"
- Next in thread: Michael Sashnikov via JavaKB.com: "Re: ArrayIndexOutOfBounds Exception in DefaultTableModel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]