table is not visible in the window. How to fix it?

38 Views Asked by At
String[] columnNames = {"Customer ID", "Name", "Address", "Salary"};
dtm = new DefaultTableModel(columnNames, 0); // 0 is row count
customerDetailsTbl = new JTable(dtm);
JScrollPane tablePane = new JScrollPane(customerDetailsTbl);
tablePane.setBounds(customerDetailsTbl.getBounds());
add(tablePane);

this is the code that I used to create table. but it does not visible in the window.

screenshot of the window

I tried many ways to solve this but didn't get any result. Can you guys help me with this

0

There are 0 best solutions below