Hello, First of all, a big thanks to all those people replied to my topic, I really appreaciate it. You guys are really helpful.
Now I would like to ask another question. My table is a 4 rows x 2 columns table, and I need to place a very long string into every cell of the second column, so I can not display all the data completely in the second column and got "..." near the right hand side vertical border(I think that means the rest of the data). I trie to use myTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF),but I have to adjust the width of the second column to get the horizontal bar. The trouble is I have to expand the width a bit to get a bit data to display, then expand the width a bit more to get a bit more data, it seems troublesome. It would be better to get a horizontal bar to scroll through the second column completely just by moving the bar, but I do not knwo how to do it. Could anyone tell me how to do it? I tried to add a scrollbar to the panel in which my table is in, but it only scrolls through the panel, not my table. For example:
JScrollPane sp = new JScrollPane(); JScrollBar jb = new JScrollBar(JScrollBar.HORIZONTAL);