May 1, 2013

A tabbed list or table for LibGdx

The TabbedList was derived from the original List widget of LibGdx.
It allows to split the list items into sub items which are positioned in individual virtual columns. Rows can be deleted and added by just modifiying the underlying data of the widget without creating or removing the widget itself or any of its child components.
Additionally, TabbedList is synchronized for a thread safe modification of the list items.



An example using the tab character as delimiter:

String[] items = {"12:00\tgame1\trunning", "13:00\tgame-2\tfinished"};
TabbedList list = new TabbedList(items, mySkin);
list.setColumnGap(20f);
list.setHeader("Time\tName\tState");


The items and the header are displayed like this:

Time  Name   State
12:00 game1  running
13:00 game-2 finished


Download at GitHub.