MyEclipse: Add new property to JComponents

deryaaltuntas - Apr 06, 2011 - 03:26 PM
Post subject: Add new property to JComponents
I have created a new custom class that extends from JPanel.
I generated a parameter named "type" and set, get methods.
When I add these custom panel to any other Panel , I want to set
type property in "Properties" window of custom JPanel.
But I could not.I think it must be a way to do this. What Am I mising?

enum SelecterType {
CONTINGENCY_LIST, CONTINGENCY, EMPTY
}

public SelecterType getType() {
return type;
}
public void setType(SelecterType type) {
this.type = type;
if(type != null && !type.equals(SelecterType.EMPTY))
populateList();
}
support-tony - Apr 08, 2011 - 08:57 AM
Post subject: RE: Add new property to JComponents
deryaaltuntas,

You need to add the custom class to the palette.

Go to the Matisse Palette pane and click the menu button, this will show only one menu item, "Manage Palette...", click it. This will bring up a palette manager window. Click the Add Widget button and then type in your custom class name. You should be able to then select your custom class and press OK. You should now be able to use your custom widget in a Matisse form and the properties should display with your "type" property.

If you still have problems after performing these steps, could you post back with more details?
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits