Galera não estou conseguindo passar o foco para o botão, oque está de errado em meu código, já teste direto no coletor e não funciona.
Segue o código, o meu botão é o bntbusca.
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == edNumeroMedidor)
btnBusca.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
} else if (e.target == btnLimpar) {
Limpar();
} else if (e.target == btnConfirmaData) {
edData.setText(pegaData());
pegaHora();
} else if (e.target == btnSair) {
exit(0);
} else if (e.target == rdExterno) {
rdInterno.setChecked(false);
} else if (e.target == rdInterno) {
rdExterno.setChecked(false);
}
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == edNumeroMedidor)
btnBusca.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == btnBusca)
edNumeroDisplayCampo.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == edNumeroDisplayCampo)
edIdCampo.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == edIdCampo)
edLeitura.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == edLeitura)
btnConfirmaData.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
switch (e.type) {
case KeyEvent.KEY_PRESS:
if (e instanceof KeyEvent) {
switch (((KeyEvent) e).key) {
case IKeys.TAB:
if (e.target == btnConfirmaData)
btnOk.requestFocus();
break;
}// fim switch interno
} // fim do if
break;
}
}