Example usage for java.awt TextArea SCROLLBARS_NONE

List of usage examples for java.awt TextArea SCROLLBARS_NONE

Introduction

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

Prototype

int SCROLLBARS_NONE

To view the source code for java.awt TextArea SCROLLBARS_NONE.

Click Source Link

Document

Do not create or display any scrollbars for the text area.

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  a  v a2s. c o  m
    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");

}

From source file:MessageViewer.java

public MessageViewer(Message what) {
    // set our layout
    super(new GridBagLayout());

    // add the toolbar
    addToolbar();/*from www  . j av  a2  s .c o m*/

    GridBagConstraints gb = new GridBagConstraints();
    gb.gridwidth = GridBagConstraints.REMAINDER;
    gb.fill = GridBagConstraints.BOTH;
    gb.weightx = 1.0;
    gb.weighty = 0.0;

    // add the headers
    headers = new TextArea("", 4, 80, TextArea.SCROLLBARS_NONE);
    headers.setEditable(false);
    add(headers, gb);

    // now display our message
    setMessage(what);
}

From source file:MessageViewer.java

/**
 * sets the current message to be displayed in the viewer
 *///from w w  w  .jav a2s .com
public void setMessage(Message what) {
    displayed = what;

    if (mainbody != null)
        remove(mainbody);

    if (what != null) {
        loadHeaders();
        mainbody = getBodyComponent();
    } else {
        headers.setText("");
        TextArea dummy = new TextArea("", 24, 80, TextArea.SCROLLBARS_NONE);
        dummy.setEditable(false);
        mainbody = dummy;
    }

    // add the main body
    GridBagConstraints gb = new GridBagConstraints();
    gb.gridwidth = GridBagConstraints.REMAINDER;
    gb.fill = GridBagConstraints.BOTH;
    gb.weightx = 1.0;
    gb.weighty = 1.0;
    add(mainbody, gb);

    invalidate();
    validate();
}