Add new property to JComponents

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #315820 Reply

    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 {

    public SelecterType getType() {
    return type;
    public void setType(SelecterType type) {
    this.type = type;
    if(type != null && !type.equals(SelecterType.EMPTY))

    #315882 Reply



    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?

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Add new property to JComponents

You must be logged in to post in the forum log in