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

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

Introduction

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

Prototype

public Point toControl(int x, int y) 

Source Link

Document

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

Usage

From source file:GetPreferredSize.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("toControl: " + button.toControl(100, 200));

    shell.open();//from  ww  w.ja  v  a2 s  .c om
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}