Class FormReference

java.lang.Object
com.jformdesigner.model.FormReference

public class FormReference extends Object
A form reference is used as property value to assign a component to a property. Normally used for JLabel.setLabelFor().

Example:

  FormComponent nameLabel = new FormComponent("javax.swing.JLabel");
  nameLabel.setName("nameLabel");
  nameLabel.setProperty("text", "Name:");
  nameLabel.setPropertyInt("displayedMnemonic", 'N');
  nameLabel.setProperty("labelFor", new FormReference("nameField"));

  FormComponent nameField = new FormComponent("javax.swing.JTextField");
  nameField.setName("nameField");
  • Constructor Details

    • FormReference

      public FormReference(String name)
      Constructs a form reference for the specified form component name.
  • Method Details

    • getName

      public String getName()
      Returns the name of the referenced form component.
    • equals

      public boolean equals(Object obj)
      Compares the names of form references.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object