private void doOk(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_doOk
   try {
     TicketDiscount selectedCoupon = getSelectedCoupon();
     if (selectedCoupon == null) {
       POSMessageDialog.showError(
           this, Messages.getString("CouponAndDiscountDialog.29")); // $NON-NLS-1$
       return;
     }
     setCanceled(false);
     dispose();
   } catch (PosException e) {
     POSMessageDialog.showError(this, e.getMessage());
   }
 } // GEN-LAST:event_doOk
 public void actionPerformed(ActionEvent e) {
   if (OK.equalsIgnoreCase(e.getActionCommand())) {
     try {
       for (ConfigurationView view : views) {
         if (view.isInitialized()) view.save();
       }
       setCanceled(false);
       dispose();
     } catch (PosException x) {
       POSMessageDialog.showError(this, x.getMessage());
     } catch (Exception x) {
       POSMessageDialog.showError(this, POSConstants.ERROR_MESSAGE, x);
     }
   } else if (CANCEL.equalsIgnoreCase(e.getActionCommand())) {
     setCanceled(true);
     dispose();
   }
 }