label.html.svn-base

来自「j2me设计的界面包」· SVN-BASE 代码 · 共 756 行 · 第 1/3 页

SVN-BASE
756
字号

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the vertical aligment of the Label, this will only work when the icon is in the side of the text and not above or bellow it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#paint(com.sun.lwuit.Graphics)">paint</A></B>(<A HREF="../../../com/sun/lwuit/Graphics.html" title="class in com.sun.lwuit">Graphics</A>&nbsp;g)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#paramString()">paramString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representing the state of this component.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setAlignment(int)">setAlignment</A></B>(int&nbsp;align)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the Aligment of the Label to one of: CENTER, LEFT, RIGHT</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setGap(int)">setGap</A></B>(int&nbsp;gap)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the gap in pixels between the icon/text to the Label boundaries</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setIcon(com.sun.lwuit.Image)">setIcon</A></B>(<A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A>&nbsp;icon)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the Label icon</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setText(java.lang.String)">setText</A></B>(java.lang.String&nbsp;text)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the Label text</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setTextPosition(int)">setTextPosition</A></B>(int&nbsp;textPosition)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the position of the text relative to the icon if exists</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/Label.html#setVerticalAlignment(int)">setVerticalAlignment</A></B>(int&nbsp;valign)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the vertical aligment of the Label to one of: CENTER, TOP, BOTTOM</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.sun.lwuit.Component"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.sun.lwuit.<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../com/sun/lwuit/Component.html#addFocusListener(com.sun.lwuit.events.FocusListener)">addFocusListener</A>, <A HREF="../../../com/sun/lwuit/Component.html#contains(int, int)">contains</A>, <A HREF="../../../com/sun/lwuit/Component.html#deinitialize()">deinitialize</A>, <A HREF="../../../com/sun/lwuit/Component.html#fireClicked()">fireClicked</A>, <A HREF="../../../com/sun/lwuit/Component.html#getAbsoluteX()">getAbsoluteX</A>, <A HREF="../../../com/sun/lwuit/Component.html#getAbsoluteY()">getAbsoluteY</A>, <A HREF="../../../com/sun/lwuit/Component.html#getBaseline(int, int)">getBaseline</A>, <A HREF="../../../com/sun/lwuit/Component.html#getBottomGap()">getBottomGap</A>, <A HREF="../../../com/sun/lwuit/Component.html#getBounds()">getBounds</A>, <A HREF="../../../com/sun/lwuit/Component.html#getComponentForm()">getComponentForm</A>, <A HREF="../../../com/sun/lwuit/Component.html#getHeight()">getHeight</A>, <A HREF="../../../com/sun/lwuit/Component.html#getNextFocusDown()">getNextFocusDown</A>, <A HREF="../../../com/sun/lwuit/Component.html#getNextFocusRight()">getNextFocusRight</A>, <A HREF="../../../com/sun/lwuit/Component.html#getParent()">getParent</A>, <A HREF="../../../com/sun/lwuit/Component.html#getPreferredH()">getPreferredH</A>, <A HREF="../../../com/sun/lwuit/Component.html#getPreferredSize()">getPreferredSize</A>, <A HREF="../../../com/sun/lwuit/Component.html#getPreferredW()">getPreferredW</A>, <A HREF="../../../com/sun/lwuit/Component.html#getScrollAnimationSpeed()">getScrollAnimationSpeed</A>, <A HREF="../../../com/sun/lwuit/Component.html#getScrollX()">getScrollX</A>, <A HREF="../../../com/sun/lwuit/Component.html#getScrollY()">getScrollY</A>, <A HREF="../../../com/sun/lwuit/Component.html#getSideGap()">getSideGap</A>, <A HREF="../../../com/sun/lwuit/Component.html#getStyle()">getStyle</A>, <A HREF="../../../com/sun/lwuit/Component.html#getWidth()">getWidth</A>, <A HREF="../../../com/sun/lwuit/Component.html#getX()">getX</A>, <A HREF="../../../com/sun/lwuit/Component.html#getY()">getY</A>, <A HREF="../../../com/sun/lwuit/Component.html#handlesInput()">handlesInput</A>, <A HREF="../../../com/sun/lwuit/Component.html#hasFocus()">hasFocus</A>, <A HREF="../../../com/sun/lwuit/Component.html#initComponent()">initComponent</A>, <A HREF="../../../com/sun/lwuit/Component.html#isBorderPainted()">isBorderPainted</A>, <A HREF="../../../com/sun/lwuit/Component.html#isEnabled()">isEnabled</A>, <A HREF="../../../com/sun/lwuit/Component.html#isFocusable()">isFocusable</A>, <A HREF="../../../com/sun/lwuit/Component.html#isFocusPainted()">isFocusPainted</A>, <A HREF="../../../com/sun/lwuit/Component.html#isInitialized()">isInitialized</A>, <A HREF="../../../com/sun/lwuit/Component.html#isScrollable()">isScrollable</A>, <A HREF="../../../com/sun/lwuit/Component.html#isScrollableX()">isScrollableX</A>, <A HREF="../../../com/sun/lwuit/Component.html#isScrollableY()">isScrollableY</A>, <A HREF="../../../com/sun/lwuit/Component.html#isScrollVisible()">isScrollVisible</A>, <A HREF="../../../com/sun/lwuit/Component.html#isSelectableInteraction()">isSelectableInteraction</A>, <A HREF="../../../com/sun/lwuit/Component.html#isSmoothScrolling()">isSmoothScrolling</A>, <A HREF="../../../com/sun/lwuit/Component.html#isVisible()">isVisible</A>, <A HREF="../../../com/sun/lwuit/Component.html#keyPressed(int)">keyPressed</A>, <A HREF="../../../com/sun/lwuit/Component.html#keyReleased(int)">keyReleased</A>, <A HREF="../../../com/sun/lwuit/Component.html#keyRepeated(int)">keyRepeated</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintBackground(com.sun.lwuit.Graphics)">paintBackground</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintBorder(com.sun.lwuit.Graphics)">paintBorder</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintComponent(com.sun.lwuit.Graphics)">paintComponent</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintScrollbars(com.sun.lwuit.Graphics)">paintScrollbars</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintScrollbarX(com.sun.lwuit.Graphics)">paintScrollbarX</A>, <A HREF="../../../com/sun/lwuit/Component.html#paintScrollbarY(com.sun.lwuit.Graphics)">paintScrollbarY</A>, <A HREF="../../../com/sun/lwuit/Component.html#pointerDragged(int, int)">pointerDragged</A>, <A HREF="../../../com/sun/lwuit/Component.html#pointerPressed(int, int)">pointerPressed</A>, <A HREF="../../../com/sun/lwuit/Component.html#pointerReleased(int, int)">pointerReleased</A>, <A HREF="../../../com/sun/lwuit/Component.html#refreshTheme()">refreshTheme</A>, <A HREF="../../../com/sun/lwuit/Component.html#refreshTheme(java.lang.String)">refreshTheme</A>, <A HREF="../../../com/sun/lwuit/Component.html#removeFocusListener(com.sun.lwuit.events.FocusListener)">removeFocusListener</A>, <A HREF="../../../com/sun/lwuit/Component.html#repaint()">repaint</A>, <A HREF="../../../com/sun/lwuit/Component.html#requestFocus()">requestFocus</A>, <A HREF="../../../com/sun/lwuit/Component.html#scrollRectToVisible(com.sun.lwuit.geom.Rectangle, com.sun.lwuit.Component)">scrollRectToVisible</A>, <A HREF="../../../com/sun/lwuit/Component.html#setBorderPainted(boolean)">setBorderPainted</A>, <A HREF="../../../com/sun/lwuit/Component.html#setCellRenderer(boolean)">setCellRenderer</A>, <A HREF="../../../com/sun/lwuit/Component.html#setEnabled(boolean)">setEnabled</A>, <A HREF="../../../com/sun/lwuit/Component.html#setFocus(boolean)">setFocus</A>, <A HREF="../../../com/sun/lwuit/Component.html#setFocusable(boolean)">setFocusable</A>, <A HREF="../../../com/sun/lwuit/Component.html#setFocusPainted(boolean)">setFocusPainted</A>, <A HREF="../../../com/sun/lwuit/Component.html#setHandlesInput(boolean)">setHandlesInput</A>, <A HREF="../../../com/sun/lwuit/Component.html#setHeight(int)">setHeight</A>, <A HREF="../../../com/sun/lwuit/Component.html#setInitialized(boolean)">setInitialized</A>, <A HREF="../../../com/sun/lwuit/Component.html#setIsScrollVisible(boolean)">setIsScrollVisible</A>, <A HREF="../../../com/sun/lwuit/Component.html#setNextFocusDown(com.sun.lwuit.Component)">setNextFocusDown</A>, <A HREF="../../../com/sun/lwuit/Component.html#setNextFocusRight(com.sun.lwuit.Component)">setNextFocusRight</A>, <A HREF="../../../com/sun/lwuit/Component.html#setPreferredH(int)">setPreferredH</A>, <A HREF="../../../com/sun/lwuit/Component.html#setPreferredSize(com.sun.lwuit.geom.Dimension)">setPreferredSize</A>, <A HREF="../../../com/sun/lwuit/Component.html#setPreferredW(int)">setPreferredW</A>, <A HREF="../../../com/sun/lwuit/Component.html#setScrollAnimationSpeed(int)">setScrollAnimationSpeed</A>, <A HREF="../../../com/sun/lwuit/Component.html#setScrollX(int)">setScrollX</A>, <A HREF="../../../com/sun/lwuit/Component.html#setScrollY(int)">setScrollY</A>, <A HREF="../../../com/sun/lwuit/Component.html#setShouldCalcPreferredSize(boolean)">setShouldCalcPreferredSize</A>, <A HREF="../../../com/sun/lwuit/Component.html#setSize(com.sun.lwuit.geom.Dimension)">setSize</A>, <A HREF="../../../com/sun/lwuit/Component.html#setSmoothScrolling(boolean)">setSmoothScrolling</A>, <A HREF="../../../com/sun/lwuit/Component.html#setStyle(com.sun.lwuit.plaf.Style)">setStyle</A>, <A HREF="../../../com/sun/lwuit/Component.html#setWidth(int)">setWidth</A>, <A HREF="../../../com/sun/lwuit/Component.html#setX(int)">setX</A>, <A HREF="../../../com/sun/lwuit/Component.html#setY(int)">setY</A>, <A HREF="../../../com/sun/lwuit/Component.html#styleChanged(java.lang.String, com.sun.lwuit.plaf.Style)">styleChanged</A>, <A HREF="../../../com/sun/lwuit/Component.html#toString()">toString</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="Label(java.lang.String)"><!-- --></A><H3>
Label</H3>
<PRE>
public <B>Label</B>(java.lang.String&nbsp;text)</PRE>
<DL>
<DD>Constructs a new label with the specified string of text, left justified.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the string that the label presents.</DL>
</DL>
<HR>

<A NAME="Label()"><!-- --></A><H3>
Label</H3>
<PRE>
public <B>Label</B>()</PRE>
<DL>
<DD>Construct an empty label
<P>
</DL>
<HR>

<A NAME="Label(com.sun.lwuit.Image)"><!-- --></A><H3>
Label</H3>
<PRE>
public <B>Label</B>(<A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A>&nbsp;icon)</PRE>
<DL>
<DD>Constructs a new label with the specified icon
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>icon</CODE> - the image that the label presents.</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getBaselineResizeBehavior()"><!-- --></A><H3>
getBaselineResizeBehavior</H3>
<PRE>
public int <B>getBaselineResizeBehavior</B>()</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../com/sun/lwuit/Component.html#getBaselineResizeBehavior()">Component</A></CODE></B></DD>
<DD>Returns a constant indicating how the baseline varies with the size of the component.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/sun/lwuit/Component.html#getBaselineResizeBehavior()">getBaselineResizeBehavior</A></CODE> in class <CODE><A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>one of BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT,         BRB_CENTER_OFFSET or BRB_OTHER</DL>
</DD>
</DL>
<HR>

<A NAME="setText(java.lang.String)"><!-- --></A><H3>
setText</H3>
<PRE>
public void <B>setText</B>(java.lang.String&nbsp;text)</PRE>
<DL>
<DD>Sets the Label text
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the string that the label presents.</DL>
</DD>
</DL>
<HR>

<A NAME="getText()"><!-- --></A><H3>
getText</H3>
<PRE>
public java.lang.String <B>getText</B>()</PRE>
<DL>
<DD>Returns the label text
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the label text</DL>
</DD>
</DL>
<HR>

<A NAME="setIcon(com.sun.lwuit.Image)"><!-- --></A><H3>
setIcon</H3>
<PRE>
public void <B>setIcon</B>(<A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A>&nbsp;icon)</PRE>
<DL>
<DD>Sets the Label icon
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>icon</CODE> - the image that the label presents.</DL>
</DD>
</DL>
<HR>

<A NAME="getIcon()"><!-- --></A><H3>
getIcon</H3>
<PRE>
public <A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A> <B>getIcon</B>()</PRE>
<DL>
<DD>Returns the labels icon
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the labels icon</DL>
</DD>
</DL>
<HR>

<A NAME="setAlignment(int)"><!-- --></A><H3>
setAlignment</H3>
<PRE>
public void <B>setAlignment</B>(int&nbsp;align)</PRE>
<DL>
<DD>Sets the Aligment of the Label to one of: CENTER, LEFT, RIGHT
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>align</CODE> - alignment value<DT><B>See Also:</B><DD><A HREF="../../../com/sun/lwuit/Component.html#CENTER"><CODE>Component.CENTER</CODE></A>, 
<A HREF="../../../com/sun/lwuit/Component.html#LEFT"><CODE>Component.LEFT</CODE></A>, 
<A HREF="../../../com/sun/lwuit/Component.html#RIGHT"><CODE>Component.RIGHT</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setVerticalAlignment(int)"><!-- --></A><H3>
setVerticalAlignment</H3>
<PRE>
public void <B>setVerticalAlignment</B>(int&nbsp;valign)</PRE>
<DL>
<DD>Sets the vertical aligment of the Label to one of: CENTER, TOP, BOTTOM
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>align</CODE> - alignment value<DT><B>See Also:</B><DD><A HREF="../../../com/sun/lwuit/Component.html#CENTER"><CODE>Component.CENTER</CODE></A>, 
<A HREF="../../../com/sun/lwuit/Component.html#TOP"><CODE>Component.TOP</CODE></A>, 
<A HREF="../../../com/sun/lwuit/Component.html#BOTTOM"><CODE>Component.BOTTOM</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getVerticalAlignment()"><!-- --></A><H3>
getVerticalAlignment</H3>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?