Example usage for org.eclipse.swt.widgets Label getStyle

List of usage examples for org.eclipse.swt.widgets Label getStyle

Introduction

In this page you can find the example usage for org.eclipse.swt.widgets Label getStyle.

Prototype

public int getStyle() 

Source Link

Document

Returns the receiver's style information.

Usage

From source file:WidgetStyle.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    Label label = new Label(shell, SWT.SHADOW_IN | SWT.CENTER);

    shell.setLayout(new GridLayout());

    if ((label.getStyle() & SWT.CENTER) != 1) {
        System.out.println("center");
    } else {/*from   w w w .j  av  a  2s  . c  o  m*/
        System.out.println("not center");
    }

    shell.setSize(260, 120);
    shell.open();

    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}