Is it possible to hide and block the last line of a DefaulTableModel
?
I have this difficulty and I can not solve it. If not, is it possible to hide this line?
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class Main extends JFrame {
DefaultTableModel model = new DefaultTableModel(new Object[][] {
{"Jack","19","Masculino"}, {"Eddie","56","Masculino"}, {"Gina","34","Feminino"},
{"Klaus","18","Masculino"}, {"Erika","20","Feminino"}, {"Roberto","29","Masculino"},{"Maria","30","Feminino"} },
new Object[] { "Nome:", "Idade:", "Sexo:" });
public Main() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTable table = new JTable(model);
getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
pack();
}
public static void main(String arg[]) {
new Main().setVisible(true);
}
}
I would like to hide the last line.