public String getApproveButtonText(JFileChooser fc) {
   String buttonText = fc.getApproveButtonText();
   if (buttonText != null) {
     return buttonText;
   } else if (fc.getDialogType() == JFileChooser.OPEN_DIALOG) {
     return openButtonText;
   } else if (fc.getDialogType() == JFileChooser.SAVE_DIALOG) {
     return saveButtonText;
   } else {
     return null;
   }
 }
 private static String approveButtonText(final JFileChooser fileChooser) {
   String text = fileChooser.getApproveButtonText();
   if (!isEmpty(text)) return text;
   return fileChooser.getUI().getApproveButtonText(fileChooser);
 }