summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing3703.java
blob: f9c616c661925d0eadf6df5b619a43989940eedb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Listing3703.java */

import java.awt.*;
import javax.swing.*;

public class Listing3703
extends JFrame
{
  public Listing3703()
  {
    super("JTextArea");
    addWindowListener(new WindowClosingAdapter(true));
    Container cp = getContentPane();
    JTextArea ta = new JTextArea("Hello, world", 20, 30);
    ta.setTabSize(4);
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    cp.add(new JScrollPane(ta));
  }

  public static void main(String[] args)
  {
    Listing3703 frame = new Listing3703();
    frame.setLocation(100, 100);
    frame.setSize(300, 200);
    frame.setVisible(true);
  }
}