LibGDX table bug?

Hello I’m trying to make a chatbox.
I have a problem, the problem is that when I add a string to the chatTable the label/string will get positioned in the middle.

what I use to add text/labels to the chatTable.

chatTable.add(username ": " + txtField.getText()).bottom().left();

More code

chatTable = new Table(GameClient.getInstance().getSkin());
chatTable.debug();
Table container = new Table(GameClient.getInstance().getSkin());
container.setBounds(81, 66, 313, 138);
container.debug();
ScrollPane scrollPane = new ScrollPane(chatTable, GameClient.getInstance().getSkin());
scrollPane.setFadeScrollBars(false);
scrollPane.setFillParent(true);
container.add(scrollPane).bottom().left().expand();
stage.addActor(container);

Please tell If I did something wrong or a more code must be posted.

The green rectangle seems to be on the correct position for the Lable and is the chatTable?
If yes:
Are you messung around with invalidate and layout?
Why do you have a container, I don’t think that you need it.
The ScrollPane is only as big as the content it holds, you want to set the size of the chatTable. (Maybe that behavior changed as I haven’t used it the last months)
If you are unsure what some actors do have a look at the getPrefWidth() and getWidth() etc. methods. A lot of actors override them and I don’t think that the behavoir is well documented so you might have to check out the source-code :slight_smile:
As I don’t know what your skin looks like I can’t tell you why the actor is outside the chatTable. Indeed I haven’t used skins yet, I prefer Layouts.

Fixed it, found out I couldn’t use setFillParent(true); on scrollpane