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.
--