Exemplo n.º 1
0
  // TableModelListener
  public void tableChanged(TableModelEvent event) {
    if (event.getType() == TableModelEvent.UPDATE) {
      EstudoTableModel model = (EstudoTableModel) event.getSource();
      this.estudosModificados.add(model.getEstudos().get(event.getFirstRow()));

      this.btnSalvar.setVisible(true && Params.canEdit());
    }
  }
Exemplo n.º 2
0
  public void reset() {
    if (this.table.getModel() instanceof EstudoTableModel) {
      EstudoTableModel model = (EstudoTableModel) this.table.getModel();
      model.setItens(this.gerenciador.listarEstudos());
      model.fireTableDataChanged();

    } else {
      EstudoTableModel model = new EstudoTableModel(this.gerenciador.listarEstudos());
      model.addTableModelListener(this);
      this.table.setModel(model);
    }

    this.btnSalvar.setVisible(false);
    this.btnRemove.setVisible(false);

    this.setColumnSize();
  }