This adds table as a child of rootTable using Group#addActor. The child will not be in a table cell in rootTable and won't be laid out by rootTable. Use Table#add to add table to a table cell in rootTable.

The table is given a skin, then you can create labels a little easier, since that is so common. Careful calling row() on a cell though. It can make code a little smaller but isn't as clear where the row ends. Also row() returns the row, not the cell, so something like row().pad(5) will set the default padding for all cells in the next row.

There is no point in using column defaults if you only have a single row. You could move right() to cell defaults, then left() on the first column. However, there is no point in using right/left at all since you are using fill(), which sizes the widget to the cell. If the widget is the size of the cell, it isn't useful to align the widget within the cell.

Finally, I'm not sure you really need .expand().fill() since you set the width of two of the columns, but maybe you do.

With this it is way easy to see your table has 3 cells in one row. I often use separate methods for create, layout, and events.

Note the setBackground(String) shortcut, since we give the table constructor a skin. Also you could use add("labeltext") to reduce the amount of code unless you actually need a reference to the label (eg, to change later).

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org