Example usage for org.eclipse.swt.widgets Button toDisplay

List of usage examples for org.eclipse.swt.widgets Button toDisplay

Introduction

In this page you can find the example usage for org.eclipse.swt.widgets Button toDisplay.

Prototype

public Point toDisplay(int x, int y) 

Source Link

Document

Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.

Usage

From source file:DisplayPositionRelative.java

public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);

    shell.setLayout(new GridLayout());

    Button button = new Button(shell, SWT.PUSH | SWT.LEFT);
    button.setText("Button");

    System.out.println("toDisplay: " + button.toDisplay(100, 200));

    shell.open();//  w  w w  . j  av a  2s  .co  m
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}