From 91867ce1e5713f9b0c598c41ae4385781c516442 Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 24 Sep 2002 06:47:38 +0000 Subject: [PATCH] Use HORIZONTAL text constraining by default. git-svn-id: https://samskivert.googlecode.com/svn/trunk@846 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/swing/MultiLineLabel.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/MultiLineLabel.java b/projects/samskivert/src/java/com/samskivert/swing/MultiLineLabel.java index 73246dbe..b9b1f236 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/MultiLineLabel.java +++ b/projects/samskivert/src/java/com/samskivert/swing/MultiLineLabel.java @@ -1,5 +1,5 @@ // -// $Id: MultiLineLabel.java,v 1.4 2002/09/24 01:31:39 shaper Exp $ +// $Id: MultiLineLabel.java,v 1.5 2002/09/24 06:47:38 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2002 Walter Korman @@ -52,7 +52,7 @@ public class MultiLineLabel extends JComponent */ public MultiLineLabel (String text) { - this(text, -1, CENTER); + this(text, HORIZONTAL, CENTER); } /** @@ -62,7 +62,7 @@ public class MultiLineLabel extends JComponent */ public MultiLineLabel (String text, int align) { - this(text, -1, align); + this(text, HORIZONTAL, align); } /** @@ -99,6 +99,14 @@ public class MultiLineLabel extends JComponent repaint(); } + /** + * Returns the text displayed by this label. + */ + public String getText () + { + return _label.getText(); + } + /** * Sets the alternate color used to display the label text. */ @@ -227,7 +235,7 @@ public class MultiLineLabel extends JComponent protected Label _label; /** The constraints we apply to the label text. */ - protected int _constrain; + protected int _constrain = HORIZONTAL; /** The off-axis alignment with which the label is positioned. */ protected int _offalign;