This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes jtable checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "jtable checkbox" Watch "jtable checkbox" New topic
Author

jtable checkbox

jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
i am having a table which get the data on the page load and has a check box for each row.

i want to perform two things on clicking the check box that is
(1) when any of the check box is clicked all other check box should get disable.

(2) the data of that particular row should get displayed in the text fields below.
Jethro Borsje
Ranch Hand

Joined: Jul 22, 2008
Posts: 100
Dear Jaimin,


Originally posted by jaimin gohel:
i am having a table which get the data on the page load and has a check box for each row.


I can't seem to find a question in your post, but I'm guessing your want to know how you can achieve both [1] and [2].

i want to perform two things on clicking the check box that is
(1) when any of the check box is clicked all other check box should get disable.

Have you thought about using JRadioButton with a ButtonGroup for this approach. Radio buttons are more commonly used when you want to achieve this kind of behaviour.

(2) the data of that particular row should get displayed in the text fields below.

You can add a action listener to the radio button which is called when you select the radio button of a specific row. Using this listener you can fetch the record number associated with it's row.

Best regards,
Jethro
[ July 30, 2008: Message edited by: Jethro Borsje ]

SCJP, SCJD
jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
thank you

for your suggestion ..........
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jtable checkbox