Label control in java


  • A label is an object of type Label & it contains a string which it displays
  • It’s a passive control that does not support any interaction with user
  • Constructors
    • Label()
    • Label(String str)
    • Label(String str, int a)
  • Methods
    • void setText(String str): Specifies new label
    • String getText( ): Returns current label
    • void setAlignment(int a): Set the alignment of the string
    • int getAlignment( ): Get the alignment of the string


Leave a Reply

Your email address will not be published. Required fields are marked *