jtextField.addKeyListener(new KeyListener(){ public void keyPressed(KeyEvent e){ String texto = jtextfield.getText(); jtextfield2.setText(texto); }});