-1

I am a newbie to Swings

Can some on please help me

I have a scenario: in which I placed JCheck boxes in the 3rd column of JTable by overriding its column class to return Boolean for the 3rd column.

So it appears as though we have check boxes in the 3rd column of the table...... lately I discovered that the table's list selection event gets fired only based on the "cell focus" in which the check box is present but not the check box itself.

i.e if the focus is on a particular cell (of 3rd column), the toggling of check box in the cell does not fire the event....

Am I missing some thing......

StanislavL
  • 56,971
  • 9
  • 68
  • 98
smoothrace
  • 59
  • 3
  • 3
    1) The renderer used in table cells is a single instance that is used to paint the cells. That means that things like buttons and check-boxes do not behave as they normally would. 2) *"Am I missing some thing......"* A `?` key? Please fix that sticky `.` key while you're at it. – Andrew Thompson Dec 14 '12 at 08:08
  • 1
    I'd start by having a look at [How to use Tables](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html), pay close attention the section on cell editors – MadProgrammer Dec 14 '12 at 08:24
  • What you have done is already existing in the API. Please go through tutorials of JTable. And before posting please try some example and show us the code where you are getting problem. – Amarnath Dec 14 '12 at 10:55

1 Answers1

2

in which I placed JCheck boxes in the 3rd column of JTable by overriding its column class to return Boolean for the 3rd column.

i.e if the focus is on a particular cell (of 3rd column), the toggling of check box in the cell does not fire the event....

Am I missing some thing......

mKorbel
  • 109,525
  • 20
  • 134
  • 319