[code]public void focusLost(FocusEvent e) {
if (e.getSource() == ft_cep) {
if (ft_cep.getText().trim().length() < 9 )
{
JOptionPane.showMessageDialog(null, "CEP invalido !", "Atenção", JOptionPane.ERROR_MESSAGE);
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
ft_cep.requestFocus();
}
});
}
}
if (e.getSource() == ft_telefone1) {
if (ft_telefone1.getText().trim().length() < 14)
{
JOptionPane.showMessageDialog(null, "Telefone invalido !", "Atenção", JOptionPane.ERROR_MESSAGE);
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
ft_telefone1.requestFocus();
}
});
}
}
if (e.getSource() == ft_telefone2) {
if (ft_telefone2.getText().trim().length() < 14)
{
JOptionPane.showMessageDialog(null, "Telefone invalido", "Atenção", JOptionPane.ERROR_MESSAGE);
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
ft_telefone2.requestFocus();
}
});
}
}
}
}[/code]
Ola a todos,
é o seguinte tenho as seguintes açoes acima, funcionado legal, o meu formulario é inicializado com todos os textfields setados como setEditable(false), o problema é quando eu clico no textfields dos eventos acima, msm eles setados como Editable(false) o evento acontece… como eu faço para solucionar isso ?
desde jah obrigado