Thursday, May 19, 2011

add row in jtable

((DefaultTableModel)jTable1.getModel()).addRow(busyIcons);

((DefaultTableModel)jTable1.getModel()).addRow(new Object [] {null, null, null, null});

add value to a specific position of a table

jTable1.getModel().setValueAt(jTextField1.getText(), 0, 3);

for each element of the array

for ( char character : charArray )
System.out.print( character );


//here char array is the array and character is each element of chararray

Convert int to string

int aInt = 1;

String aString = Integer.toString(aInt);