All About Class Label in AWT in Java



Label are String representation of a display text.A label is a component for placing text in a container.The text can be changed by the application but user can not edit it.
The class structure of Label is given as below:


public class java.awt.Label extends java.awt.Component{
//member elements:
public final static int CENTER;//indicates that the label should be centered.
public final static int LEFT;//indicates that the label should be left justified.
public final static int RIGHT;//indicates that the label should be right justified.
//constructors
public Label();//default constructor creates an empty label whose label is left justified
public Label(String label)//creates a label with the specified argument whose label is left justified
public Label(String label,int alignment);//creates a label with the specified argument and alignment 
//alignment could be Label.CENTER ,Label.LEFT or Label.RIGHT
//methods
public void addNotify();
public int getAlignment();
public String getText();
protected String paramString();
public void setAlignment(int alignment);
public void setText(String label);
 
All About Class Label in AWT in Java All About Class Label in AWT in Java Reviewed by Animesh Chatterjee on October 25, 2018 Rating: 5

No comments:

Powered by Blogger.