Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Label

Advertisement
A displayed label object is known as the Label. Most of the times label is used to demonstrate the significance of the other parts of the GUI. It helps to display the functioning of the next text field. A label is also restricted to a single line of text

Label

     

A displayed label object is known as the Label. Most of the times label is used to demonstrate the significance of the other parts of the GUI. It helps to display the functioning of the next text field. A label is also restricted to a single line of text as a button. The example below shows the significance of Label.


In this example, we have added two labels in the applet as shown.

 

 

import java.awt.*; 
import java.applet.Applet; 
 
public class MyLabel extends Applet 
  public void init() { 
  add(new Label("label one"))
  add(new Label("label two", Label.RIGHT))
  

Here is the output: 

C:\newprgrm>javac MyLabel.java

C:\newprgrm>appletviewer MyLabel.html

 

Download this example.

 

 

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 13, 2008

Ask Questions?    Discuss: Label   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
n.aravindhan
October 18, 2011
java

how to create attendence process with using jdbc?
chandu nimje
January 8, 2012
college managment system

java basic
DMCA.com