I am experiencing a drawing aberration of one or two pixels between components, in which the background shines through. The margins of the involved components is 0, so there should be no gap of anything shining through.

To illustrate: a simple Form having a background image, a content container with white background and the southern component of the toolbar is having a rounded image, also in white, to have a visually appealing separation between the toolbar and the content: enter image description here

As seen in the second illustration, in special cases, there is a thin line drawn between the toolbar and the content container, which has a horrible visual impact.

To reproduce:

  1. when swiping from the top within the toolbar downwards into the content container, the line briefly appears, while swiping over the white rounded image.
  2. when swiping from the content container upwards into the toolbar, the line appears and stays.

I assumed this has something to do with the unselected/selected/pressed UIID styles, however I copied the unselected styles everywhere with the same 0 margin and it didnt change anything.

here is the minimal code to reproduce:

public void start() {
    if (current != null) {
    Form hi = new Form(new BorderLayout());

private void addToolbar(Form hi) {
    Toolbar toolbar = hi.getToolbar();

    Label divider = new Label(" ", "ToolbarDivider");
    toolbar.add(BorderLayout.SOUTH, divider);

    Label spacer = new Label(" ", "ToolbarSpacer");
    toolbar.add(BorderLayout.EAST, spacer);

private void addContent(Form hi) {
    Container whiteContainer = new Container();
    whiteContainer.add(new Label("content"));

    hi.add(BorderLayout.CENTER, whiteContainer);

Note: ToolbarDivider is a style to have the white rounded image as background with zero margins and paddings. Toolbar Spacer is having a top margin which is added to the right of the toolbar to make it bigger and more appealing (my app has more content to show in the toolbar).

Any help in why this line is occurring would be appreciated.

0 Answers