I have another jframe where when clicking a button the jframe where I have this table changes the names of the columns of the table, this is the code of the table
public void desicionmetodos(int a){
switch (a){
case 1:
Object[] columnNames = {"N","Xn","Yn=Xn^2","Xn+1","Rn+1"};
DefaultTableModel metodocuadradomedio = (DefaultTableModel) TablaUniversal.getModel();
metodocuadradomedio.addColumn(columnNames);
TablaUniversal.setModel(metodocuadradomedio);
break;
}
}