Grazie mille, ora funzione. ti riporto cosa ho fatto:

codice:
textField_4 = new JTextField();
textField_4.addKeyListener(new KeyAdapter() {
	NumberDocument numberDocument = new NumberDocument();
	@Override
	public void keyPressed(KeyEvent arg0) {
	textField_4.setDocument(numberDocument);
				}
	});
se puoi, potresti ripetermi l'errore, non l'ho capito bene.
Ancora grazie.

Ma il bottone per il tag [code] dove si trova?

nh