public class Game extends ApplicationAdapter {
batch = new SpriteBatch();
Gdx.input.setInputProcessor(stage);
Table table = new Table();
table.setFillParent(true);
final TextButton button = new TextButton("Click me!", skin);
button.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
System.out.println("Clicked! Is checked: " + button.isChecked());
button.setText("Good job!");
private void prepareSkin() {
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
skin.add("white", new Texture(pixmap));
skin.add("default", new BitmapFont());
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.down = skin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.checked = skin.newDrawable("white", Color.BLUE);
textButtonStyle.over = skin.newDrawable("white", Color.LIGHT_GRAY);
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f));
public void resize (int width, int height) {
stage.getViewport().update(width, height, true);