filmov
tv
How to Exception in thread _AWT-EventQueue-0_ java .lang. ArrayIndexOutOfBoundException _ 1=1FIX2023

Показать описание
How to Solve Exception in thread _AWT-EventQueue-0_ java .lang. ArrayIndexOutOfBoundException _ 1=1 [FIXED] 2023 SOLVED
1
Please check what is going on in:
They seem to be your own classes.
In particular if you select any row in the table before the setRowCount(0) is called there is possibility of a selection change event being generated with either first or last index as -1.
So you should probably add check on the value of index being valid before proceeding further.
If your run following code and select second row in the table you will see selection event being fired with -1 as first index. So you should guard against same in your RowListener.
1
Please check what is going on in:
They seem to be your own classes.
In particular if you select any row in the table before the setRowCount(0) is called there is possibility of a selection change event being generated with either first or last index as -1.
So you should probably add check on the value of index being valid before proceeding further.
If your run following code and select second row in the table you will see selection event being fired with -1 as first index. So you should guard against same in your RowListener.