jasonh
jasonh

Reputation: 30303

JFace ApplicationWindow white line at top of Window

I've created the most basic JFace ApplicationWindow I can think of and I get this 1 pixel white border at the top of the screen:

alt text

And the code to create it:

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.SWT;

public class TestWindow extends ApplicationWindow {
    public TestWindow() {
        super(null);
    }

    protected Control createContents(Composite parent) {
        this.getShell().setText("Test Window");

        parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
        return parent;
    }
}

As I add additional Composite controls to the window, the gap gets even bigger. What can I do to get rid of it?

Upvotes: 1

Views: 556

Answers (2)

BloodyNobody
BloodyNobody

Reputation: 23

I don't know if you're still looking for help on this, but all you have to do is add

this.seperator1.dispose();

in the createContents(Composite) method. Looking at the source, I saw that the separator is really just a (misspelled) label: seperator1.

Upvotes: 0

qrtt1
qrtt1

Reputation: 7957

You can try to override the function:

protected boolean showTopSeperator() {
    return false;
}

Upvotes: 2

Related Questions