we have api which has JOption Pane like below

this is in api call

return (String)RSSJOptionPane.showInputDialog(SwingUtilit ies.getRoot(this),
"Select the pool name to apply:",
"Select MPN Pool Name", JOptionPane.PLAIN_MESSAGE, null, options, options[0]);

this is code for showInputDialog:

public static Object showInputDialog(Component parentComponent, Object message, String title, int messageType,
Icon icon, Object[] selectionValues, Object initialSelectionValue) throws HeadlessException {
RSSJOptionPane pane = new RSSJOptionPane(message, messageType, OK_CANCEL_OPTION, icon, null, null);

pane.setWantsInput(true);
pane.setSelectionValues(selectionValues);
pane.setInitialSelectionValue(initialSelectionValu e);
pane.setComponentOrientation(((parentComponent == null) ? getMyRootFrame() : parentComponent)
.getComponentOrientation());

int style = styleFromMessageType(messageType);
JDialog dialog = pane.createDialog(parentComponent, title, style);

pane.selectInitialValue();
// SUN HAD THIS DONE BADLY - REMOVED SHOW() AND DISPOSE() - BLOCKING ON VISIBLE
// 2 RAPID BOXES GOT THE SAME VALUE - AND BLOCKING WAS NOT FUNCTIONING CORRECTLY
dialog.setVisible(true);
dialog.toFront();

while (dialog.isVisible()) {
try {
Thread.sleep(100);
} catch (Exception e) {
}
}

Object value = pane.getInputValue();

if (value == UNINITIALIZED_VALUE) {
return null;
}
return value;
}


I need to add one test foeld after option pane and before OK,Cancle button...how do i do that ...