public void validateIdPuesto(JTextField a) {
        a.addKeyListener(new KeyAdapter() {

            @Override
            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();
                if (c != '2' && c != '1') {
                    getToolkit().beep();
                    e.consume();
                }
            }
        });
    }