lo solucione momentaneamente de la siguiente manera:
Código Declaracion::
Ver originalpublic DefaultTableModel model;
public DefaultTableModel mM1, mM2, mM3, mM4, mM5, mM6, mM7, mM8, mM9, mM10;
public int ticket;
private List<String> listTicket;
Código Metodos:
Ver originalpublic void botonTicket(JButton boton, DefaultTableModel modN){
DefaultTableModel auxModel, aux = null;
aux = modelosBotones(aux);
try {
auxModel = (DefaultTableModel) tabla.getModel();
boolean celdaVaciaTabla = (auxModel.getValueAt(0, 0).equals("") || auxModel.getValueAt(0, 0).equals(null));
boolean celdaVaciaModelo;
if (modN != null){
celdaVaciaModelo = (modN.getValueAt(0, 0).equals("") || modN.getValueAt(0, 0).equals(null));
}else{
celdaVaciaModelo = false;
}
if (celdaVaciaTabla && (boton.getText().length() > 1))
{
modelos(modN, auxModel);
tabla.setModel(auxModel);
modN = new DefaultTableModel();
modN = modelosBotones(modN);
int intBoton = Integer.parseInt(boton.getText().substring(1, boton.getText().length()));
String strBoton = boton.getText();
boton.setText("");
ticket = intBoton-1; //resto un ticket menos que el que se quito
listTicket.remove(strBoton);
}else{
/** si los dos estan vacios o los dos tienen ticket, que no intercambie nada y no incremente el ticket*/
if(!celdaVaciaTabla && celdaVaciaModelo ){
modelos(auxModel, modN);
initTabla(null);
boolean esta;
do{
ticket++;
esta = listTicket.contains("M"+ticket);
}while(esta);
if(!esta){
listTicket.add("M"+ticket);
boton.setText("M"+ticket);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/** Intercambio los DefaultTableModel con este metodo
* @param DefaultTableModel modViejo: el modelo con datos
* @param DefaultTableModel modNuevo: el modelo en blanco, donde se copiaran los datos.
* */
public void modelos(DefaultTableModel modViejo, DefaultTableModel modNuevo) {
int filas = modViejo.getRowCount();
int col = modViejo.getColumnCount();
int i = 0, j = 0;
boolean BFilas = false;
while (i<filas && !BFilas) {
if (modViejo.getValueAt(i,j) == null || modViejo.getValueAt(i,j) == "")
BFilas = true;
else{
while (j < col){
modNuevo.setValueAt(modViejo.getValueAt(i,j), i,j);
modViejo.setValueAt("", i,j);
j++;
}
i++;
j = 0;
}
}
}
con estas modificaciones logre que haga lo que estoy buscando.
Si alguien me puede indicar como mejorarlo, sera bien venido.
Saludos.