• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem in JTable row selection

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
Shans


 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just another cross poster.
http://www.java-forums.org/awt-swing/15562-problem-jtable-row-selection.html
http://forums.sun.com/thread.jspa?threadID=5364804
 
Marshal
Posts: 70215
281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke is right: please look at this FAQ.
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic