Example usage for java.awt TextArea append

List of usage examples for java.awt TextArea append

Introduction

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

Prototype

public void append(String str) 

Source Link

Document

Appends the given text to the text area's current text.

Usage

From source file:TimerTest.java

public void init() {
    Panel panel = new Panel();
    String header = new String("              J3D Timer                System Timer\n");
    TextArea textArea = new TextArea(header, 12, 35, TextArea.SCROLLBARS_NONE);
    panel.add(textArea);/*from  w w  w. j av a 2s.  c  om*/
    this.add(panel);

    for (int i = 0; i < ticks.length; i++) {
        ticks[i] = J3DTimer.getValue();
        sysTime[i] = System.currentTimeMillis();
    }

    for (int i = 0; i < ticks.length; i++)
        //System.out.println("tick "+ticks[i]+" "+sysTime[i] );
        textArea.append("tick " + ticks[i] + "    " + sysTime[i] + "\n");
    //System.out.println("Resolution "+J3DTimer.getResolution() );
    textArea.append("Resolution " + J3DTimer.getResolution() + "\n");

}