Example usage for java.awt Label setSize

List of usage examples for java.awt Label setSize

Introduction

In this page you can find the example usage for java.awt Label setSize.

Prototype

public void setSize(int width, int height) 

Source Link

Document

Resizes this component so that it has width width and height height .

Usage

From source file:SimpleInputMethod.java

public void setInputMethodContext(InputMethodContext context) {
    inputMethodContext = context;//www.  j a  v  a2 s  .  com
    if (statusWindow == null) {
        statusWindow = context.createInputMethodWindow("Simple Input Method", false);
        Label label = new Label();
        label.setText(locale.getDisplayName());
        statusWindow.add(label);
        label.setSize(200, 50);
        statusWindow.add(label);
        statusWindow.pack();

        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        statusWindow.setLocation(d.width - statusWindow.getWidth(), d.height - statusWindow.getHeight());
    }
}