Skip to content

Commit

Permalink
created a new factory method for the JLabel in the LabelPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
astrapi69 committed Jul 22, 2023
1 parent 2f3510d commit 8c1790a
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ public LabelPanel(final IModel<String> model)
@Override
protected void onInitializeComponents()
{
lblText = new JLabel();
lblText = newJLabel();
lblText.setText(getModelObject());
add(lblText);
}

/**
* Factory method that creates a new {@link JLabel} object. You can overwrite this method and
* return your new custom {@link JLabel} object
*
* @return the {@link JLabel} object
*/
protected JLabel newJLabel()
{
return new JLabel();
}

@Override
protected void onInitializeLayout()
{
Expand Down

0 comments on commit 8c1790a

Please sign in to comment.