Access the autocreated text field of JOptionPane is theoretically possible, but it's IMHO wrong way.
Here is the better solution:
JOptionPane has a hidden feature: it accepts also Swing components as messages. So you need to create a panel with lable and text field (with your DocumentFilter) and pass it to a confirm dialog. After confirmation you can read the text from your text field.
Here is sample:
JPanel p = new JPanel(new FlowLayout());
JTextField fld = new JTextField(10);
// set document filter for 'fld' here
p.add(new JLabel("Enter text: "));
p.add(fld);
int val = JOptionPane.showConfirmDialog(null, p, "Test", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null);
if (JOptionPane.OK_OPTION == val) {
System.out.println("Text: " + fld.getText());
}