Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: JToggleButt...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 11 Topic 16060 of 16268
Post > Topic >>

Re: JToggleButton event firing

by "John B. Matthews" <nospam@[EMAIL PROTECTED] > May 12, 2008 at 08:42 AM

In article 
<64bb689b-59ba-4f2a-8109-408cc671f0f6@[EMAIL PROTECTED]
>,
 Redbeard <tom.cowdery@[EMAIL PROTECTED]
> wrote:

> On May 11, 11:48 am, "John B. Matthews" <nos...@[EMAIL PROTECTED]
> wrote:
> > In article
> > <cd26e5b0-3633-4c3f-934b-404d4edeb...@[EMAIL PROTECTED]
>, 
> > Redbeard <tom.cowd...@[EMAIL PROTECTED]
> wrote:
> >
> > [...]
> >
> > I think it's the ToggleButtonModel that's responsible for the
behavior.
> > Why not instantiate JToggleButton and set the model to an extension of
> > DefaultButtonModel that overrides isArmed().
> >
> > [...]
> 
> Sounds like an idea that is worth a try.  Thanks!

Sorry, I misspoke: set the model to an extension of ToggleButtonModel 
that overrides isArmed(). I think you still want the "toggle" behavior, 
just not the "armed" behavior. Also note: the button model fires both 
ActionEvent (for pressed) and ItemEvent (for both selected and 
deselected), as part of the "group" notion for check boxes and radio 
buttons.

It might be cleaner to extend AbstractButton and DefaultButtonModel to 
create, in effect, a JConcentrationButton. The custom model could 
enforce rules like "no peeking" and "exposing a third card flips the 
other two," etc.

John
-- 
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 




 11 Posts in Topic:
JToggleButton event firing
Redbeard <tom.cowdery@  2008-05-07 19:18:08 
Re: JToggleButton event firing
Mark Space <markspace@  2008-05-07 19:55:34 
Re: JToggleButton event firing
Redbeard <tom.cowdery@  2008-05-07 20:25:13 
Re: JToggleButton event firing
Knute Johnson <nospam@  2008-05-07 22:17:56 
Re: JToggleButton event firing
Roedy Green <see_websi  2008-05-11 12:00:34 
Re: JToggleButton event firing
Redbeard <tom.cowdery@  2008-05-08 04:27:53 
Re: JToggleButton event firing
Knute Johnson <nospam@  2008-05-08 08:43:16 
Re: JToggleButton event firing
Redbeard <tom.cowdery@  2008-05-10 20:46:56 
Re: JToggleButton event firing
"John B. Matthews&qu  2008-05-11 12:48:37 
Re: JToggleButton event firing
Redbeard <tom.cowdery@  2008-05-11 18:58:53 
Re: JToggleButton event firing
"John B. Matthews&qu  2008-05-12 08:42:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 17:41:46 CDT 2008.