Here you can find the source of addInputValidator(final DocumentListener inputValidator, final JTextField... textFields)
Parameter | Description |
---|---|
inputValidator | input validator |
textFields | text fields |
public static void addInputValidator(final DocumentListener inputValidator, final JTextField... textFields)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import javax.swing.event.DocumentListener; public class Main { /**//from www.j a v a2s .c o m * Adds input validator to text fields. * * @param inputValidator input validator * @param textFields text fields */ public static void addInputValidator(final DocumentListener inputValidator, final JTextField... textFields) { for (final JTextField textField : textFields) { textField.getDocument().addDocumentListener(inputValidator); } } }