Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > only 2 check boxes from four at a time checked

Reply
Thread Tools

only 2 check boxes from four at a time checked

 
 
Kgbol
Guest
Posts: n/a
 
      06-13-2007
Could somebody tell me, ore give a code. I want to make 4 check boxes
and max 2 of them could be checked at a time.

 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      06-13-2007
Kgbol wrote On 06/13/07 14:58,:
> Could somebody tell me, ore give a code. I want to make 4 check boxes
> and max 2 of them could be checked at a time.


If you want to do this "often," consider writing a class
that mimics javax.swing.ButtonGroup (you probably don't want
to write a subclass of ButtonGroup, because getSelection and
some other methods can only talk about one button, not two
or more).

If you want to do this "just a few times," you can hard-
wire the logic into your button listeners. Keep track of how
many buttons are checked, and when the count reaches the limit
disable all the unchecked buttons. When a checked button is
unchecked and the count decreases, re-enable them.

--
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Kgbol
Guest
Posts: n/a
 
      06-14-2007
Ok i did how you told and it works fine. Thanks a lot

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Canon EIS mirrorless system - Four Thirds, but not Four Thirds! Bruce Digital Photography 31 09-25-2010 05:38 AM
CheckBox Checked=false when checked in DataList yurps ASP .Net 1 02-29-2008 01:08 PM
Get the datafield of check boxes that checked in datagrid(with java script)? ahmad_n80 ASP .Net 0 07-21-2007 09:38 AM
URGENT HELP - form submit stops working when so many check boxes checked - Why? Dave Smithz HTML 17 07-18-2005 02:13 AM
select all check boxes at a time with check all [Javascript] [Chatakondu Gallery] Suresh Javascript 2 04-22-2004 03:47 PM



Advertisments