Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
how to position element ? (client side component development question)
hello vaadiners
Have a problem which I haven't been able to solve on my own
basically I would like to position labels (a task and its caption) in an absolutepanel in a way that the task starts at a certain x position , and its caption is on its right ( so the caption right and the task left edge is at the same x position )
here is my code, and I attached a screenshot about what I would like to achieve
displayComponentPanel.add(eventElement, (int) x, (int) y);
displayComponentPanel.add(eventCaption);
int eventCaptionWidth = eventCaption.getOffsetWidth();
displayComponentPanel.setWidgetPosition(eventCaption,(int) x-eventCaptionWidth,(int) y);
displayComponentPanel is a gwt absolutepanel, eventElement and eventCaption are gwt labels
what is wrong with my code ?
how can I position the elements properly?