From 6c9a29b4bd3540190e7b839f1bc638735bacd43f Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 15 Sep 2006 01:19:55 +0000 Subject: [PATCH] Allow custom Label derivations to be used with MultiLineLabel. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1907 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/swing/MultiLineLabel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/swing/MultiLineLabel.java b/src/java/com/samskivert/swing/MultiLineLabel.java index 413d7554..829ab789 100644 --- a/src/java/com/samskivert/swing/MultiLineLabel.java +++ b/src/java/com/samskivert/swing/MultiLineLabel.java @@ -80,7 +80,7 @@ public class MultiLineLabel extends JComponent */ public MultiLineLabel (String text, int align, int constrain, int size) { - _label = new Label(text); + _label = createLabel(text); _label.setAlignment(align); noteConstraints(constrain, size); } @@ -306,6 +306,14 @@ public class MultiLineLabel extends JComponent layoutLabel(); } + /** + * Creates the underlying {@link Label} that we use to render our text. + */ + protected Label createLabel (String text) + { + return new Label(text); + } + /** * Called when the label has changed in some meaningful way and we'd * accordingly like to re-layout the label, update our component's