pessoal estou com um problema , criei uma classe pra deixar todos componentes em vermelho caso estejam vazio ,mas não encontram o txt pq estão fora do frame e nunca iram achar ...
como poderia fazer isso , teria que usar HERANÇA!
//segue os codigospackage util.enabled;
import java.awt.Color;
import view.FrmCadastro.FrmCadastro;
public class enabled extends FrmCadastro {
private static final long serialVersionUID = 1L;
public enabled(){
/* verifica se o campos esta vazio */
if (txtCodigo.getText().equals("")){
/*seta o background para vermelho */
txtBairro.setBackground(Color.RED);
txtCodigo.setBackground(Color.RED);
txtComplemento.setBackground(Color.RED);
txtCpf.setBackground(Color.RED);
txtDataNascimento.setBackground(Color.RED);
txtEndereco.setBackground(Color.RED);
txtNomesegurado.setBackground(Color.RED);
txtNumero.setBackground(Color.RED);
txtPremio.setBackground(Color.RED);
txtCEP.setBackground(Color.RED);
cmbProduto.setBackground(Color.RED);
cmbSexo.setBackground(Color.RED);
cmbUF.setBackground(Color.RED);
} else {
/*seta o background para branco */
txtBairro.setBackground(Color.WHITE);
txtCodigo.setBackground(Color.WHITE);
txtComplemento.setBackground(Color.WHITE);
txtCpf.setBackground(Color.WHITE);
txtDataNascimento.setBackground(Color.WHITE);
txtEndereco.setBackground(Color.WHITE);
txtNomesegurado.setBackground(Color.WHITE);
txtNumero.setBackground(Color.WHITE);
txtPremio.setBackground(Color.WHITE);
txtComplemento.setBackground(Color.WHITE);
txtCEP.setBackground(Color.WHITE);
cmbProduto.setBackground(Color.WHITE);
cmbSexo.setBackground(Color.WHITE);
cmbUF.setBackground(Color.WHITE);
}
}
}
//aki onde eu chamo todos eles
private void btnConsistirActionPerformed(java.awt.event.ActionEvent evt) {
}