I made a Jtable in my class, but once it fills up the whole designing page, it can't display the content further down. I decided to make the table scrollable. Below are my codes to initialize the Jtable:
brandTbl.setModel(new DefaultTableModel(
new Object[][] {
{null, null, null},
{null, null, null},
},
new String[] {
"Name", "Status", "ID"
}
));
brandTbl.setFont(new Font("Tahoma", Font.PLAIN, 14));
brandTbl.setFillsViewportHeight(true);
brandTbl.setColumnSelectionAllowed(true);
brandTbl.setCellSelectionEnabled(true);
brandTbl.setBackground(Color.WHITE);
brandTbl.setBounds(490, 125, 480, 271);
contentPane.add(brandTbl);
I tried to use JScrollPane, but my IDE told me it can't be resolved to a type.