<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.Label
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.Insets.html#_top_">Previous</a>  <a href="java.awt.List.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.Label
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.awt.Component.html#_top_">java.awt.Component</a>
           |
           +----java.awt.Label
</pre>
<hr>
<dl>
  <dt> public class <b>Label</b>
  <dt> extends <a href="java.awt.Component.html#_top_">Component</a>
</dl>
A <code>Label</code> object is a component for placing text in a 
 container. A label displays a single line of read-only text.
 The text can be changed by the application, but a user cannot edit it 
 directly.  
 <p>
 For example, the code&nbsp;.&nbsp;.&nbsp;.
 <p>
 <hr><blockquote><pre>
 setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); 
 add(new Label("Hi There!")); 
 add(new Label("Another Label"));
 </pre></blockquote><hr>
 <p>
 produces the following label:
 <p>
 <img src="images-awt/Label-1.gif" 
 ALIGN=center HSPACE=10 VSPACE=7>
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#CENTER"><b>CENTER</b></a>
  <dd> 
 Indicates that the label should be centered.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#LEFT"><b>LEFT</b></a>
  <dd>  Indicates that the label should be left justified.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#RIGHT"><b>RIGHT</b></a>
  <dd>  Indicates that the label should be right justified.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Label()"><b>Label</b></a>()
  <dd>  Constructs an empty label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Label(java.lang.String)"><b>Label</b></a>(String)
  <dd>  Constructs a new label with the specified string of text, 
 left justified.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Label(java.lang.String, int)"><b>Label</b></a>(String, int)
  <dd>  Constructs a new label that presents the specified string of 
 text with the specified alignment.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addNotify()"><b>addNotify</b></a>()
  <dd>  Creates the peer for this label.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlignment()"><b>getAlignment</b></a>()
  <dd> 
 Gets the current alignment of this label.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getText()"><b>getText</b></a>()
  <dd> 
 Gets the text of this label.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#paramString()"><b>paramString</b></a>()
  <dd>  Returns the parameter string representing the state of this 
 label.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setAlignment(int)"><b>setAlignment</b></a>(int)
  <dd> 
 Sets the alignment for this label to the specified alignment.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setText(java.lang.String)"><b>setText</b></a>(String)
  <dd> 
 Sets the text for this label to the specified text.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="LEFT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>LEFT</b>
<pre>
 public static final int LEFT
</pre>
<dl>
  <dd> Indicates that the label should be left justified.<p>
</dl>
<a name="CENTER"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>CENTER</b>
<pre>
 public static final int CENTER
</pre>
<dl>
  <dd> Indicates that the label should be centered.<p>
</dl>
<a name="RIGHT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>RIGHT</b>
<pre>
 public static final int RIGHT
</pre>
<dl>
  <dd> Indicates that the label should be right justified.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Label"></a>
<a name="Label()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Label</b>
<pre>
 public Label()
</pre>
<dl>
  <dd> Constructs an empty label.
<p>
</dl>
<a name="Label(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Label</b>
<pre>
 public Label(<a href="java.lang.String.html#_top_">String</a> text)
</pre>
<dl>
  <dd> Constructs a new label with the specified string of text, 
 left justified.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> text - the string that the label presents.
  </dl></dd>
</dl>
<a name="Label(java.lang.String, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Label</b>
<pre>
 public Label(<a href="java.lang.String.html#_top_">String</a> text,
              int alignment)
</pre>
<dl>
  <dd> Constructs a new label that presents the specified string of 
 text with the specified alignment.
 <p>
 Possible values for <code>alignment</code> are <code>Label.LEFT</code>, 
 <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> text - the string that the label presents.
    <dd> alignment - the alignment value.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="addNotify()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addNotify"><b>addNotify</b></a>
<pre>
 public void addNotify()
</pre>
<dl>
  <dd> Creates the peer for this label.  The peer allows us to
 modify the appearance of the label without changing its 
 functionality.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#addNotify()">addNotify</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<a name="getAlignment()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlignment"><b>getAlignment</b></a>
<pre>
 public int getAlignment()
</pre>
<dl>
  <dd> Gets the current alignment of this label. Possible values are
 <code>Label.LEFT</code>, <code>Label.RIGHT</code>, and 
 <code>Label.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#setAlignment">setAlignment</a>
  </dl></dd>
</dl>
<a name="setAlignment(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setAlignment"><b>setAlignment</b></a>
<pre>
 public synchronized void setAlignment(int alignment)
</pre>
<dl>
  <dd> Sets the alignment for this label to the specified alignment.
 Possible values are <code>Label.LEFT</code>, 
 <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> alignment - the alignment to be set.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if an improper value for
                          <code>alignment</code> is given.
    <dt> <b>See Also:</b>
    <dd> <a href="#getAlignment">getAlignment</a>
  </dl></dd>
</dl>
<a name="getText()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getText"><b>getText</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getText()
</pre>
<dl>
  <dd> Gets the text of this label.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the text of this label.
    <dt> <b>See Also:</b>
    <dd> <a href="#setText">setText</a>
  </dl></dd>
</dl>
<a name="setText(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setText"><b>setText</b></a>
<pre>
 public synchronized void setText(<a href="java.lang.String.html#_top_">String</a> text)
</pre>
<dl>
  <dd> Sets the text for this label to the specified text.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> text - the text that this label presents.
    <dt> <b>See Also:</b>
    <dd> <a href="#getText">getText</a>
  </dl></dd>
</dl>
<a name="paramString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="paramString"><b>paramString</b></a>
<pre>
 protected <a href="java.lang.String.html#_top_">String</a> paramString()
</pre>
<dl>
  <dd> Returns the parameter string representing the state of this 
 label. This string is useful for debugging.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the parameter string of this label.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#paramString()">paramString</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.Insets.html#_top_">Previous</a>  <a href="java.awt.List.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
