michael nesterenko
michael nesterenko

Reputation: 14449

Strange separator on empty jface window

I have just created an empty jface window. But for some reason there is separator at the top of the window:

enter image description here

With menu bar it looks pretty ok. But if there is no menu bar that separator is shown nevertheless!

enter image description here

How can it be eliminated?

UPD

class Application extends ApplicationWindow {
    /**
     * @param parentShell
     */
    public Application() {
        super(null);
    }

    @Override
    protected Control createContents(final Composite parent) {
        prepareShell(getShell());
        return parent;
    }

    protected void prepareShell(final Shell shell) {
        shell.setSize(450, 300);
    }
}

and main class

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Application app = new Application();
        app.setBlockOnOpen(true);
        app.open();

        Display.getCurrent().dispose();
    }

}

Upvotes: 1

Views: 169

Answers (1)

aphex
aphex

Reputation: 3412

You could extend Window, not Application window. The Window class doesn't have menu and status. Also you wouldn't have separator on the top of the screen.

Another way to solve the problem is to override the showTopSeperator() from ApplicationWindow

protected boolean showTopSeperator() {
    return false;
}

Upvotes: 1

Related Questions