public JTextField createFilterTextField ( int columnIndex ) { while ( textFields . size ( ) - 1 < columnIndex ) { textFields . add ( null ) ; } JTextField textField = new JTextField ( ) ; textFields . set ( columnIndex , textField ) ; Document document = textField . getDocument ( ) ; document . addDocumentListener ( new DocumentListener ( ) { @ Override public void removeUpdate ( DocumentEvent e ) { updateFilter ( ) ; } @ Override public void insertUpdate ( DocumentEvent e ) { updateFilter ( ) ; } @ Override public void changedUpdate ( DocumentEvent e ) { updateFilter ( ) ; } } ) ; return textField ; }
Create the text field for the specified column