Help with custom component creation

Hi all,
I’m making some custom components using the Ignition SDK ComponentExample as a loose template and I’ve run into a bit of a brick wall. I made a nifty little jPanel element that builds nicely into an importable module and shows up where it should in a custom Component Palette tab, and does everything that I want it to so far, but the problem I’m having is getting it to display all the custom properties I want to add. Some do show up, though, and I can’t tell why others don’t.

In the following code the ‘text’ field shows up but 'isClicked does not. I have variables declared before calling initComponents:

public String text = "Look at That!"; private boolean isClicked = false; public PushPinRight() { initComponents(); }

[code] public String getText() {
return text;
}
public void setText(String text) {
// Firing property changes like this is required for any property that has the BOUND_MASK set on it.
// (See this component’s BeanInfo class)
String old = this.text;
this.text = text;
firePropertyChange(“text”, old, text);
repaint();
}

public boolean getisClicked() {
    return isClicked;
    
}
public void setisClicked(boolean isClicked) {
	// Firing property changes like this is required for any property that has the BOUND_MASK set on it.
	// (See this component's BeanInfo class)
	boolean old = this.isClicked;
	this.isClicked = isClicked;
	firePropertyChange("isClicked", old, isClicked);
	repaint();
}[/code]

and in the BeanInfo file

super.initProperties(); addProp("text", "Text", "The text to display in the component", CAT_DATA, BOUND_MASK); addProp("isClicked", "Is Clicked", "holds open popup information when True", CAT_DATA, BOUND_MASK);

Does anyone have an idea as to why one works and the other does not? Thanks in advance for any help.

Your getter/setter naming for isClicked is wrong - you need to follow JavaBean conventions.

The proper naming for a boolean “clicked” would be setClicked() and isClicked().

The boolean is declared as “isClicked”.

Well change it to “clicked” and then use the getter/setter names I suggested and see if it works.

Interesting, that worked, although I still can’t use that property to change the variable’s condition from the Property Window. Does that have to do with a naming convention, like ‘get’ or ‘set’ must be followed by a capital letter to be recognized?

Yeah, along with some more rules. It’s referred to as the JavaBean naming convention - you may want to read about that a bit.

Naming a boolean variable ‘isClicked’ is not best practice and would result in you needing setters/getters named something like ‘setIsClicked()’ and ‘isIsClicked()’ - I think…

Thanks for your help!