In Java, you can display tables of data by using the JTable class. JTable simply view your data and your data is not cached by that class. You can use the following code for creating the data.
Code:
String[] columnNames = {"Name",
"Place",
"Game",
"Age",
"Color"};
Its data is initialized and stored in a two-dimensional Object array:
Object[][] data = {
{"Nuyrew", "California",
"Snowboarding", new Integer(7), new Boolean(false)},
{"Fyun", "Humi",
"Rowing", new Integer(5), new Boolean(true)},
{"Kathy", "Indies",
"Knitting", new Integer(4), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), new Boolean(true)},
{"Philip", "Milan",
"Pool", new Integer(10), new Boolean(false)}
};
Bookmarks