Originally posted by EMRE CANIAZ: yes i am waiting answer from anyone 1.why we must use doClick() 2.i cant give any size to checkbox
Unlike a typical cell renderer, this one maintains some state. This means that this renderer can't be shared among multiple columns in a table (or among multiple tables), but an individual instance is required for each column.
With that in mind, I wouldn't say that we "must use" doClick(). It's just a handy way to toggle the state of the renderer between the selected state and the unselected state. Instead of doing doClick() we could instead do something like selectedState = !selectedState, where selectedState is a boolean field that we have added to the class. Then in getTableCellRendererComponent() we would have to do rendererComponent.setSelected(selectedState). (Perhaps this is what you are attempting to do with the mousePressed field?)
As for size, the table resizes the renderer for each cell before it paints it.