private void addContents ( String text ) { int firstColSelected = table . getSelectedColumn ( ) ; int firstRowSelected = table . getSelectedRow ( ) ; int temp = firstColSelected ; if ( firstColSelected == - 1 || firstRowSelected == - 1 ) { return ; } ArrayList < ArrayList < String > > clipboard = parseString ( text ) ; for ( int i = 0 ; i < clipboard . size ( ) ; i ++ ) { for ( int j = 0 ; j < clipboard . get ( i ) . size ( ) ; j ++ ) { try { table . getModel ( ) . setValueAt ( clipboard . get ( i ) . get ( j ) , firstRowSelected , temp ++ ) ; } catch ( Exception e ) { } } temp = firstColSelected ; firstRowSelected ++ ; } }
this adds the text to the jtable