CtrlConsultaLivros

From Grupo1 Ahand

Revision as of 00:59, 21 May 2007 by Denise cunha (Talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)

package livraria;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

import livraria.Livro;
import livraria.Livros;

public class CtrlConsultaLivros {

// private TMsgErro tMsgErro;
private PropertyChangeSupport pcs = new PropertyChangeSupport(this);

public void addPropertyChangeListener(PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
}

public Livro ConsultarLivro(Livro livro) {
Livros livros = Livros.getInstance();
Livro livroPesq = livros.getLivro(livro);

if (livroPesq == null) {

String msgErro = "Livro invalido!";
pcs.firePropertyChange("msgErro", null, msgErro);
}

return livroPesq;

}

}

Personal tools