swing - Create JTable with different row numbers in Java -
i create jtable 2 items in first row, 1 item in second row, 2 items in third row, 1 item in fourth row, , on. in addition, first item in rows 2 items aligned left , second item in rows 2 items aligned right. item in rows 1 item aligned left. first 4 rows like:
---------------------------- | item 1 item 2 | | iteeeeem 3 //end of item 3| | item 4 item 5 | | iteeeeeeeeeeeeeeeeeeeem 6 | _____________________________,
or table looks
so far, code is
model = new defaulttablemodel(); model.addcolumn(""); model.addcolumn(""); model.addcolumn(""); (int = 0; < number_of_rows; i++){ model.addrow(new object[] { item_1, item_2, item_3 });}
this adds 3 items same row. how can tweak code need?
thanks!
Comments
Post a Comment