Example usage for java.awt TextArea setText

List of usage examples for java.awt TextArea setText

Introduction

In this page you can find the example usage for java.awt TextArea setText.

Prototype

public synchronized void setText(String t) 

Source Link

Document

Sets the text that is presented by this text component to be the specified text.

Usage

From source file:de.codesourcery.eve.skills.ui.components.impl.PriceInfoComponent.java

@Override
protected JPanel createPanelHook() {

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    final String kind;

    switch (priceType) {
    case BUY:/*from   w w  w  .  j  a v a  2 s  .  co  m*/
        kind = "buy";
        break;
    case SELL:
    default:
        throw new RuntimeException(
                "Invalid data in switch/case: PriceInfo.Type.ALL cannot be queried from user");
    }

    minPrice.addActionListener(listener);
    maxPrice.addActionListener(listener);
    avgPrice.addActionListener(listener);

    final TextArea desc = new TextArea();
    desc.setText(message);
    desc.setEditable(false);

    panel.add(desc, constraints(0, 0).width(2).resizeBoth().end());

    panel.add(new JLabel("Minimum " + kind + " price"), constraints(0, 1).useRelativeWidth().end());
    panel.add(minPrice, constraints(1, 1).useRemainingWidth().end());

    panel.add(new JLabel("Average " + kind + " price"), constraints(0, 2).useRelativeWidth().end());
    panel.add(avgPrice, constraints(1, 2).useRemainingWidth().end());

    panel.add(new JLabel("Maximum " + kind + " price"), constraints(0, 3).useRelativeWidth().end());
    panel.add(maxPrice, constraints(1, 3).useRemainingWidth().end());

    return panel;
}