summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing3810.java
blob: 3555f122eb518e3cadcee18262941a3588a9d333 (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
29
30
31
/* Listing3810.java */

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

public class Listing3810
extends JFrame
implements TableData
{
  public Listing3810()
  {
    super("JTable 4");
    addWindowListener(new WindowClosingAdapter(true));
    JTable table = new JTable(DATA, COLHEADS);
    table.setDefaultRenderer(
      Object.class,
      new ColoredTableCellRenderer()
    );
    Container cp = getContentPane();
    cp.add(new JLabel("Alte c\'t-Ausgaben:"), BorderLayout.NORTH);
    cp.add(new JScrollPane(table), BorderLayout.CENTER);
  }

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