Toms
Toms

Reputation: 239

Why is my table not showing column names?

enter image description here

String[] i2ColumnNames = {"Sr. No."
                          "Head ID",
                          "Name",
                          "Category",
                          "Financial Year",
                          "Debit",
                          "Credit"};

Upvotes: 1

Views: 79

Answers (1)

dic19
dic19

Reputation: 17971

Here:

i2t1sp1 = new JScrollPane(i2Table1);
layout.row().left().add(i2Table1);

You need to replace this line:

 layout.row().left().add(i2Table1);

by this one:

layout.row().left().add(i2t1sp1);

You're not adding the scroll pane but the table directly to the layout.

Off topic

Always follow Java Code Conventions. Variables must have meaningful names.

Upvotes: 3

Related Questions