![]() |
||
![]() |
![]() Alden Hosting provides professional, efficient, and reliable business-class Web hosting services to small- and medium-sized businesses. |
|
|
JAVA, JSP, SERVLETS, TOMCAT, SERVLETS MANAGER, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Method or Constructor | Purpose |
|---|---|
|
JLabel(Icon) JLabel(Icon, int) JLabel(String) JLabel(String, Icon, int) JLabel(String, int) JLabel() |
Creates a JLabel instance,
initializing it to have the specified text/image/alignment.
The int argument
specifies the horizontal alignment
of the label's contents within its drawing area.
The horizontal alignment must be one of the following constants
defined in the
SwingConstants interface (which JLabel implements):
LEFT, CENTER, RIGHT,
LEADING, or TRAILING.
For ease of localization,
we strongly recommend using
LEADING and TRAILING,
rather than LEFT and RIGHT.
|
|
void setText(String) String getText() |
Sets or gets the text displayed by the label. You can use HTML tags to format the text, as described in Using HTML in Swing Components. |
|
void setIcon(Icon) Icon getIcon() |
Sets or gets the image displayed by the label. |
|
void setDisplayedMnemonic(char) char getDisplayedMnemonic() |
Sets or gets the letter
that should look like a keyboard alternative.
This is helpful when a label describes a
component (such as a text field)
that has a keyboard alternative
but cannot display it.
If the labelFor property is also set
(using setLabelFor),
then when the user activates the mnemonic,
the keyboard focus is transferred to the
component specified by the labelFor property.
|
|
void setDisplayedMnemonicIndex(int) int getDisplayedMnemonicIndex() |
Sets or gets a hint as to which character in the text should be decorated
to represent the mnemonic. This is useful when you have two instances
of the same character and wish to decorate the second instance.
For example, setDisplayedMnemonicIndex(5)
decorates the character that is at position 5
(that is, the 6th character in the text).
Not all types of look and feel may support this feature.
|
|
void setDisabledIcon(Icon) Icon getDisabledIcon() |
Sets or gets the image displayed by the label when it is disabled. If you do not specify a disabled image, then the look and feel creates one by manipulating the default image. |
| Method | Purpose |
|---|---|
|
void setHorizontalAlignment(int) void setVerticalAlignment(int) int getHorizontalAlignment() int getVerticalAlignment() |
Sets or gets the area on the label where its contents should be placed.
The
SwingConstants interface defines five possible values for horizontal alignment:
LEFT,
CENTER (the default for image-only labels),
RIGHT,
LEADING (the default for text-only labels),
TRAILING.
For vertical alignment:
TOP,
CENTER (the default), and
BOTTOM.
|
|
void setHorizontalTextPosition(int) void setVerticalTextPosition(int) int getHorizontalTextPosition() int getVerticalTextPosition() |
Sets or gets the location where the button's text will be placed,
relative to the button's image.
The
SwingConstants interface defines five possible values
for horizontal position:
LEADING,
LEFT,
CENTER,
RIGHT, and
TRAILING (the default).
For vertical position:
TOP,
CENTER (the default), and
BOTTOM.
|
|
void setIconTextGap(int) int getIconTextGap() |
Sets or gets the number of pixels between the label's text and its image. |
| Method | Purpose |
|---|---|
|
void setLabelFor(Component) Component getLabelFor() |
Sets or gets which component the label describes. |
The following table lists some of the many examples that use labels.
Example Where Described Notes LabelDemoThis section Shows how to specify horizontal and vertical alignment as well as how to align a label's text and image. HtmlDemoUsing HTML in Swing Components Lets you experiment with specifying HTML text for a label. BoxAlignmentDemoFixing Alignment Problems Demonstrates possible alignment problems when using a label in a vertical box layout. Shows how to solve the problem. DialogDemoHow to Use Dialogs Uses a changeable label to display instructions and provide feedback. SplitPaneDemoHow to Use Split Panes and How to Use Lists Displays an image using a label inside of a scroll pane. SliderDemo2How to Use Sliders Uses JLabelto provide labels for a slider.TableDialogEditDemoHow to Use Tables Implements a label subclass, ColorRenderer, to display colors in table cells.FormattedTextFieldDemoHow to Use Formatted Text Fields Has four rows, each containing a label and the formatted text field it describes. TextComponentDemoText Component Features TextComponentDemohas an inner class (CaretListenerLabel) that extendsJLabelto provide a label that listens for events, updating itself based on the events.ColorChooserDemoHow to Use Color Choosers Uses an opaque label to display the currently chosen color against a fixed-color background.
Alden Hosting offers private JVM (Java Virtual Machine), Java Server Pages (JSP), Servlets, and Servlets Manager with our Web Hosting Plans WEB 4 PLAN and WEB 5 PLAN , WEB 6 PLAN .
At Alden Hosting we eat and breathe Java! We are the industry leader in providing affordable, quality and efficient Java web hosting in the shared hosting marketplace. All our sites run on our Java hosing platform configured for optimum performance using Java 1.6, Tomcat 6, MySQL 5, Apache 2.2 and web application frameworks such as Struts, Hibernate, Cocoon, Ant, etc.
We offer only one type of Java hosting - Private Tomcat. Hosting accounts on the Private Tomcat environment get their very own Tomcat server. You can start and re-start your entire Tomcat server yourself.
![]() |
|
http://alden-servlet-Hosting.com
JSP at alden-servlet-Hosting.com
Servlets at alden-servlet-Hosting.com
Servlet at alden-servlet-Hosting.com
Tomcat at alden-servlet-Hosting.com
MySQL at alden-servlet-Hosting.com
Java at alden-servlet-Hosting.com
sFTP at alden-servlet-Hosting.com
http://alden-tomcat-Hosting.com
JSP at alden-tomcat-Hosting.com
Servlets at alden-tomcat-Hosting.com
Servlet at alden-tomcat-Hosting.com
Tomcat at alden-tomcat-Hosting.com
MySQL at alden-tomcat-Hosting.com
Java at alden-tomcat-Hosting.com
sFTP at alden-tomcat-Hosting.com
http://alden-sftp-Hosting.com
JSP at alden-sftp-Hosting.com
Servlets at alden-sftp-Hosting.com
Servlet at alden-sftp-Hosting.com
Tomcat at alden-sftp-Hosting.com
MySQL at alden-sftp-Hosting.com
Java at alden-sftp-Hosting.com
sFTP at alden-sftp-Hosting.com
http://alden-jsp-Hosting.com
JSP at alden-jsp-Hosting.com
Servlets at alden-jsp-Hosting.com
Servlet at alden-jsp-Hosting.com
Tomcat at alden-jsp-Hosting.com
MySQL at alden-jsp-Hosting.com
Java at alden-jsp-Hosting.com
sFTP at alden-jsp-Hosting.com
http://alden-java-Hosting.com
JSp at alden-java-Hosting.com
Servlets at alden-java-Hosting.com
Servlet at alden-java-Hosting.com
Tomcat at alden-java-Hosting.com
MySQL at alden-java-Hosting.com
Java at alden-java-Hosting.com
sFTP at alden-java-Hosting.com
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP at JSP.aldenWEBhosting.com
Servlets at servlets.aldenWEBhosting.com
Tomcat at Tomcat.aldenWEBhosting.com
mysql at mysql.aldenWEBhosting.com
Java at Java.aldenWEBhosting.com
Web Hosts Portal
Web Links
Web Links
Web Hosting
JSP Solutions Web Links
JSP Solutions Web Hosting
Servlets Solutions Web Links
Servlets Solutions Web Hosting
Web Links
Web Links
.
.
.
.
.
.
.
.
.
.
jsp hosting
servlets hosting
web hosting
web sites designed
cheap web hosting
web site hosting
myspace web hosting