This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Problem in JTable row selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in JTable row selection" Watch "Problem in JTable row selection" New topic

Problem in JTable row selection

Shans sat

Joined: Jan 24, 2009
Posts: 12
Dear Friends,
I'm using JTable in my application. It has 4 columns and rows are fetched from database. 1st column contains JCheckBox to select the particular row in the table. 1st column header also contains JCheckBox. All rows in the table are selected and unselected by check and uncheck the column header JCheckBox.

The problem is,
If I check anyone of the row JCheckBox then the particular row got selected and If I check the column header JCheckBox then that check box is checked and all rows are selected.

But If I check the 1st row JCheckBox then the 1st row got selected and If I check the Column header JCheckBox then column header JCheckBox is chekced but no rows are selected (1st row also deselected).

I tested the same scenario for 2nd and 3rd rows but everything works fine. Only 1st row gives this problem.

My Code is,

APUCheckBoxHeader class :

MyItemListener class :

Could anyone please tell me how to solve this issue?

Thanks in advance,

Darryl Burke

Joined: May 03, 2008
Posts: 4523

Just another cross poster.

luck, db
There are no new questions, but there may be new answers.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38033
Darryl Burke is right: please look at this FAQ.
Consider Paul's rocket mass heater.
subject: Problem in JTable row selection
Similar Threads
Adding checkbox in table column
Select All checkbox in Jtable
Check Box in JTable header
Freeze Pane in JTable
checkbox Table problem