Package me.araopj.cscreen.components
Class Button
- java.lang.Object
-
- me.araopj.cscreen.components.Button
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetText()Gets the text currently displayed on the button.voidplace(Screen sc)Overrides the `place` method from the `Components` class.voidsetHeight(int height)Overrides the `setHeight` method from the `Resizable` interface.voidsetText(String text)Sets the text to be displayed on the button.voidsetWidth(int width)Overrides the `setWidth` method from the `Resizable` interface.
-
-
-
Field Detail
-
r
protected int r
-
c
protected int c
-
charSets
protected CharSets charSets
-
-
Constructor Detail
-
Button
public Button(int r, int c, String text)Constructs a `Button` with specified row, column, and text.- Parameters:
r- The row position of the button.c- The column position of the button.text- The text to be displayed on the button.
-
Button
public Button(int r, int c)Constructs a `Button` with specified row and column positions.- Parameters:
r- The row position of the button.c- The column position of the button.
-
-
Method Detail
-
setText
public void setText(String text)
Sets the text to be displayed on the button.- Parameters:
text- The new text to be set.
-
getText
public String getText()
Gets the text currently displayed on the button.- Returns:
- The text displayed on the button.
-
place
public void place(Screen sc)
Overrides the `place` method from the `Components` class. Places the button on the provided screen.- Parameters:
sc- The `Screen` object on which the button is placed.
-
setWidth
public void setWidth(int width)
Overrides the `setWidth` method from the `Resizable` interface. Sets the width of the button.
-
-