Don't use null
Layout, instead use LayoutManagers
. Java created for you amazing layouts, you just have to use it, and let the layout do your job instead of hard working of calculating the position and size.
That's my answer, but if you insist of using it, just call setBounds(x,y,width,height)
method for the JTable
.
But again, don't use absolute positioning(null
Layout).
//....
JScrollPane scrol = new JScrollPane(table);
scrol.setBounds(table.getBounds());
//....