Guest User

Untitled

a guest
May 13th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1.  tfPlacamae.addActionListener(new ActionListener() {
  2.  
  3.             @Override
  4.             public void actionPerformed(ActionEvent e) {
  5.                 ManipulaArquivo manipulaArquivo = new ManipulaArquivo();
  6.                 List<String> listaAuxiliar = manipulaArquivo.abrirArquivo("PlacaMae.dat");
  7.  
  8.                 if (listaAuxiliar.size() > 0) {
  9.                     String selectedItem = new JanelaPesquisar(listaAuxiliar, getBounds().x - getWidth() / 2 + getWidth() + 5, getBounds().y).getValorRetornado();
  10.                     if (!selectedItem.equals("")) {
  11.                         String[] aux = selectedItem.split(";");
  12.  
  13.                         tfPlacamae.setText(aux[1] + " - " + aux[2]);
  14.  
  15.                     } else {
  16.                         tfPlacamae.requestFocus();
  17.                         tfPlacamae.selectAll();
  18.                     }
  19.                 }
  20.             }
  21.         });
Advertisement
Add Comment
Please, Sign In to add comment