Package me.araopj.cscreen.components
Class Label
- java.lang.Object
-
- me.araopj.cscreen.components.Label
-
public class Label extends Object
The `Label` class represents a simple label component that displays text on a screen. It extends the `Components` class to inherit basic component functionality.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetText()Retrieves the current text content of the label.voidplace(Screen sc)Places the label on the screen by updating the screen array with its text content.voidsetText(String text)Sets the text content of the label.
-
-
-
Field Detail
-
r
protected int r
-
c
protected int c
-
charSets
protected CharSets charSets
-
-
Constructor Detail
-
Label
public Label(int r, int c, String text)Constructs a `Label` with the specified row, column, and text.- Parameters:
r- The row position of the label on the screen.c- The column position of the label on the screen.text- The text content of the label.
-
Label
public Label(int r, int c)Constructs a `Label` with the specified row and column.- Parameters:
r- The row position of the label on the screen.c- The column position of the label on the screen.
-
-
Method Detail
-
place
public void place(Screen sc)
Places the label on the screen by updating the screen array with its text content.- Parameters:
sc- The `Screen` object representing the screen to which the label is being added.
-
setText
public void setText(String text)
Sets the text content of the label.- Parameters:
text- The new text content for the label.
-
getText
public String getText()
Retrieves the current text content of the label.- Returns:
- The text content of the label.
-
-