= radiobutton
:author: 
:revnumber: 
:revdate: 2016/03/17 20:48
:relfileprefix: ../../../
:imagesdir: ../../..
ifdef::env-github,env-browser[:outfilesuffix: .adoc]



== RadioButton Class

*  RadioButton's extend the CheckBox class
*  They provide a default label (which is only added if the label text is set).
*  They provide the abstract method onChange for executing code when the RadioButton is altered by the user.

Again, the same three options for constructor are available as show in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.

*Constructor 1:*

[source,java]
----

/** Parameters:
  * Screen screen,
  * String UID,
  * Vector2f position
  */
 
RadioButton rb = new RadioButton(screen, “rb”, new Vector2f(15, 15));

----

*Constructor 2:*

[source,java]
----

/** Additional Parameter:
  * Vector2f dimensions  */
 
RadioButton rb = new RadioButton(screen, “rb”, new Vector2f(15, 15),
    new Vector2f(25, 25)
);

----

*Constructor 3:*

[source,java]
----

/** Additional Parameters:
  * Vector4f resizeBorders,
  * String defaultImg
  */
 
RadioButton rb = new RadioButton(screen, “rb”, new Vector2f(15, 15), new Vector2f(25, 25),
    new Vector4f(3,3,3,3),
    “tonegod/gui/style/def/Button/radiobutton_u_x.png”
);

----


=== Hover State

You can override the default hover state using the following method:

[source,java]
----

// Override the information used by the hover effect
cb.setButtonHoverInfo(String imagePath, ColorRGBA textHoverColor);

----


=== Pressed State

You can override the default pressed state using the following method:

[source,java]
----

// Override the information used by the pressed effect
cb.setButtonPressedInfo(String imagePath, ColorRGBA textPressedColor);

----


=== Abstract Event Methods:

[source,java]
----

public void onChange(boolean isChecked);

----
