public void setOKPressed() { // // It is important to call setOKPressed before calling isInputValid // otherwise we run into an infinite loop of actionPerformed calls. // okCancelPanel.setOKPressed(true); if (getCurrentChooser().isInputValid()) { setVisible(false); } }
void okCancelPanel_actionPerformed(ActionEvent e) { if (!okCancelPanel.wasOKPressed() || getCurrentChooser().isInputValid()) { setVisible(false); } // sstein: added else-if to fix MAC-OSX-bug else if ((okCancelPanel.wasOKPressed()) && (CheckOS.isMacOsx())) { // --sstein: leave out validation - because it returns always "false" on Mac-OSX ? // System.out.println("validate input:" + getCurrentChooser().isInputValid()); // System.out.println("i am inside"); okCancelPanel.setOKPressed(true); setVisible(false); } }
/* recogemos el evento cd se pulsa Aceptar */ void this_componentShown(ComponentEvent e) { okCancelPanel.setOKPressed(false); }