Community
Participate
Working Groups
A Label showing numbers should paint its text right aligned, but the position of the text is computed with regard of its preferred size: Dimension offset = getSize().getDifference(getPreferredSize()); When using GridLayout and GridData, the GridData sets the Figure's preferred size directly: Dimension size = figure.getPreferredSize(widthHint, heightHint); if (widthHint != -1) size.width = widthHint; if (heightHint != -1) size.height = heightHint; The problem is, when you use a hint: Label label = new Label("0"); label.setLabelAlignment(PositionConstants.RIGHT); GridData data = new GridData(); data.horizontalAlignment = SWT.FILL: data.widthHint = 100; container.add(label, data); Then is the text painted on the left side instead of right size.