package com.javatutor.insel.ui.table;
import java.awt.Dimension;
import javax.swing.*;
public class SimpleTable
{
public static void main( String[] args )
{
String[][] rowData = {
{ "Japan", "245" }, { "USA", "240" }, { "Italien", "220" },
{ "Spanien", "217" }, {"Türkei", "215"} ,{ "England", "214" },
{ "Frankreich", "190" }, {"Griechenland", "185" },
{ "Deutschland", "180" }, {"Portugal", "170" }
};
String[] columnNames = {
"Land", "Durchschnittliche Fernsehdauer pro Tag in Minuten"
};
JPanel panel = new JPanel();
panel.setBounds(10,10,600,600);
JFrame f = new JFrame();
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
JTable table = new JTable( rowData, columnNames );
panel.add(table);
f.add( new JScrollPane( panel ) );
f.setPreferredSize(new Dimension(600,600));
f.pack();
f.setVisible( true );
}
}