Image

Hi everyone, I'm new here. I have a bit of a problem with some code, I'm more interested in the angle of which to approach the solving of this problem as I would like to learn along the way. I sent this to the Java forum, but as yet I haven't had a reply.

Any ideas...


I have constructed a simple JTable using my own TableModel that extends AbstractTableModel. I enter two columns of data, the first is of Object of type String, and the second is of type Boolean. Having constucted my own simple TableModel I now get JCheckBox's rather than the String values "true" and "false". Easy so far :o)

I then set:

table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

If you select the top left cell and drag down that column of String values, you should see the cells being highlighted accordingly as you pass over each one. However, try left click and hold on the top right cell (in the second column, the cells with JCheckBox) drag down to another cell in it's column and then let go. The original cell is now grey, and the cell you released the mouse on is highlighted. I don't want to have the original cell greyed, how do I get rid of it? If feel that its something to do with the fact that the cell comprises of a JCheckBox.

To have got this far, the code is pretty simple but if you want to see it I'll put it up.

Thanks :o)


Any help in any form would be appreciated, thanks :o)