Home » Eclipse Projects » WindowBuilder » JTable data display(Displaying data within a JTable)
JTable data display [message #1013041] |
Fri, 22 February 2013 16:50 |
Bill Brandley Messages: 12 Registered: October 2011 |
Junior Member |
|
|
I created a JTable named "table" on a JScrollPane using WindowBuilder. To understand how it works, I populated it within a button thusly:
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
Object[][] data = {
{"Kathy", "Smith","Snowboarding", new Integer(5), new Boolean(false)},
{"John", "Doe", "Rowing", new Integer(3), new Boolean(true)},
{"Sue", "Black", "Knitting", new Integer(2), new Boolean(false)},
{"Jane", "White", "Speed reading", new Integer(20), new Boolean(true)},
{"Joe", "Brown", "Pool", new Integer(10), new Boolean(false)}
}
table = new JTable(data, columnNames);
I have no errors, but when I click the button, I get no data appearing in the JTable.
Can anyone tell me what I am missing?
Thanks,
Bill
|
|
| | | |
Goto Forum:
Current Time: Thu Mar 28 21:34:43 GMT 2024
Powered by FUDForum. Page generated in 0.02690 seconds
|