Example usage for com.google.gwt.canvas.client Canvas setFocus

List of usage examples for com.google.gwt.canvas.client Canvas setFocus

Introduction

In this page you can find the example usage for com.google.gwt.canvas.client Canvas setFocus.

Prototype

public void setFocus(boolean focused) 

Source Link

Usage

From source file:com.trollworks.webkeycodes.WebKeyCodes.java

License:Open Source License

@Override
public void onModuleLoad() {
    RootLayoutPanel root = RootLayoutPanel.get();
    TextArea log = new TextArea();
    log.setStylePrimaryName("log");
    log.setEnabled(false);/*from   w  ww. j a v a 2s. c o  m*/
    FlowPanel outer = new FlowPanel();
    outer.setStylePrimaryName("outer");
    outer.add(log);
    KeyCapturePanel capturePanel = new KeyCapturePanel(log);
    Canvas canvas = capturePanel.getCanvas();
    outer.add(canvas);
    root.add(outer);
    canvas.setFocus(true);
}