> I wrote a simple bean that has one boolean property called checkOn.
>
[quoted text clipped - 7 lines]
>
> public class TempCheck extends Panel{
What's wrong with Swing (in this context)? It's not 1997 any more.
> setLayout(new BorderLayout());
> checkbox = new Checkbox("Hello", true);
> add(checkbox, BorderLayout.CENTER);
> checkOn = true;
There is a problem here is that you have duplicated state, which more
often than not causes bugs. You seem to be okay here, but it is more by
luck than judgement that you have both values initialised to the same
value, and should keep updated together (unless there are any exceptions).
> checkbox.addItemListener(
> new ItemListener(){
[quoted text clipped - 6 lines]
> support.firePropertyChange("", null, null);
> }
You should fill in the correct values here...
> } // end itemStateChanged
> } // end ItemListener
> ); // end checkbox.addItemListener
> } // end constructor
Do these comments help?
> public boolean getCheckOn(){ return checkOn; }
Conventionally boolean properties getters start with is. Also On is kind
of redundant for boolean properties. Something like isChecked would be
better.
> private PropertyChangeSupport support = new PropertyChangeSupport(this);
>
[quoted text clipped - 5 lines]
> support.removePropertyChangeListener(pcl);
> }
You are overriding Component methods here. No need to have support (but
do make sure you fire on the correct object). You will prevent all the
other properties of your component working, which may foul the internal
workings.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/