break; case 1:  break; case 2: SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose();  break; default: break;
break; case 1:  break; case 2: SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose();  break; default: break; }
   public SendEMailDialog(Frame parent, Screen5250 screen ) {      JPanel semp = new JPanel();      semp.setLayout(new AlignLayout(2,5,5));      JLabel tol = new JLabel(LangTool.getString("em.to"));      JTextField tot = new JTextField(30);      JLabel subl = new JLabel(LangTool.getString("em.subject"));      JTextField subt = new JTextField(30);      JLabel fnl = new JLabel(LangTool.getString("em.fileName"));      JTextField fnt = new JTextField("tn5250j.txt",30);      semp.add(tol);      semp.add(tot);      semp.add(subl);      semp.add(subt);      semp.add(fnl);      semp.add(fnt);      Object[]      message = new Object[1];      message[0] = semp;      String[] options = {LangTool.getString("em.optSendLabel"),                           LangTool.getString("em.optCancelLabel"),                           LangTool.getString("em.optConfigureLabel")};      int result = 0;      while (result == 0 || result == 2) {         result = JOptionPane.showOptionDialog(             parent,                            // the parent that the dialog blocks             message,                           // the dialog message array             LangTool.getString("em.title"),    // the title of the dialog window             JOptionPane.DEFAULT_OPTION,        // option type             JOptionPane.QUESTION_MESSAGE,      // message type             null,                              // optional icon, use null to use the default icon             options,                           // options string array, will be made into buttons//             options[0]                         // option that should be made into a default button         );         switch(result) {            case 0: // Send it               SendEMail sem = new SendEMail();               sem.setConfigFile("SMTPProperties.cfg");               sem.setTo(tot.getText());               sem.setSubject(subt.getText());               if (fnt.getText().length() > 0)                  sem.setFileName(fnt.getText());               StringBuffer sb = new StringBuffer();               char[] s = screen.getScreenAsChars();               int c = screen.getCols();               int l = screen.getRows() * c;               int col = 0;               for (int x = 0; x < l; x++,col++) {                  sb.append(s[x]);                  if (col == c) {                     sb.append('\n');                     col = 0;                  }               }               sem.setMessage(sb.toString());               try {                  sem.send();               }               catch (IOException ioe) {                  System.out.println(ioe.getMessage());               }               sem.release();               sem = null;               System.out.println("Message sent");               break;            case 1: // Cancel   //		      System.out.println("Cancel");               break;            case 2: // Configure SMTP               SMTPConfig smtp = new SMTPConfig(parent,"",true);               smtp.setVisible(true);               smtp.dispose();   //		      System.out.println("Cancel");               break;            default:               break;         }      }   }