Example usage for java.awt TextArea TextArea

List of usage examples for java.awt TextArea TextArea

Introduction

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

Prototype

public TextArea() throws HeadlessException 

Source Link

Document

Constructs a new text area with the empty string as text.

Usage

From source file:ClipMe.java

ClipMe() {
    super("Clipping Example");
    add(tf = new TextField("Welcome"), "North");
    add(ta = new TextArea(), "Center");
    ta.setEditable(false);// ww  w . j  a va 2 s . c o  m
    Panel p = new Panel();
    p.add(copy = new Button("Copy"));
    p.add(paste = new Button("Paste"));
    add(p, "South");
    setSize(250, 250);
}

From source file:sourcegetter.SourceGetter.java

SourceGetter() {
    super("INSTANT DUNZZZ");
    l = new JLabel("SongName");
    l.setBounds(50, 50, 80, 20);//ww w.  j ava 2 s  .c om

    tf = new JTextField();
    tf.setBounds(120, 50, 250, 20);

    b = new JButton("Download");
    b.setBounds(120, 100, 120, 30);
    b.addActionListener(this);

    ta = new TextArea();
    ta.setBounds(120, 150, 250, 150);

    add(l);
    add(tf);
    add(b);
    add(ta);
    setSize(400, 400);
    setLayout(null);
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

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 .java 2s.  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;
}