At first, a new bean class has to be created, wich will be registered in the new Bean-Scheme.
To register the following bean class LabPanel in Bean-Scheme, the full qualified class path, e.g. com.oda.evaTest.bean.LabPanel, is to be specified.
public class LabPanel extends JPanel { private JLabel labelling; public LabPanel() { setLayout(new BorderLayout()); labelling = new JLabel(); Border labellingBorder = BorderFactory.createEmptyBorder(); labelling.setBorder(labellingBorder); add(labelling, "North"); } public String getLabelText() { return labelling.getText(); } public void setLabelText(String string) { labelling.setText(string); } }
The class LabPanel extends the class JPanel by a JLabel. The methods
public String getLabelText()
and
public void setLabelText(String string)
can set or get the marking of the JLabel.
The setter and getter methods are to be named according to the property entries in the Bean-Schema.