how can I make a cell be 'selected'?

Hi,

I have implemented a copy-paste feature for my JTable. However, I have been asked if I can make the next to last 'pasted' cell be automatically selected after paste operation, so the user can copy-paste groups of continues data without moving the mouse.

Ok, I now it is hard to describe but is there any way for me to change a cell's state to 'selected'?

Thanks for your time.

[412 byte] By [xpantaa] at [2007-11-27 8:15:28]
# 1

If i have understood your problem correctly then you should just be able to use the following: -

jTable.changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)

Try checking the JTable API for explanations of the arguments for the method

c0demonk3ya at 2007-7-12 20:00:15 > top of Java-index,Desktop,Core GUI APIs...
# 2
thanks a bunch! It works! :-)
xpantaa at 2007-7-12 20:00:15 > top of Java-index,Desktop,Core GUI APIs...