} else {
} else if (graphic.isSelected()){
	public SendEMailDialog(Frame parent, Session session) {		if (!isEMailAvailable()) {			JOptionPane.showMessageDialog(				parent,				LangTool.getString("messages.noEmailAPI"),				"Error",				JOptionPane.ERROR_MESSAGE,				null);		} 		else {			this.session = session;			Screen5250 screen = session.getScreen();			Object[] message = new Object[1];			message[0] = setupMailPanel("tn5250j.txt");			String[] options = new String[3];			int result = 0;			while (result == 0 || result == 2) {				// setup the dialog options				setOptions(options);				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.PLAIN_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 btn				);				switch (result) {					case 0 : // Send it						SendEMail sem = new SendEMail();						sem.setConfigFile("SMTPProperties.cfg");						sem.setTo((String) toAddress.getSelectedItem());						sem.setSubject(subject.getText());						if (bodyText.getText().length() > 0)							sem.setMessage(bodyText.getText());						if (attachmentName.getText().length() > 0)							sem.setAttachmentName(attachmentName.getText());						if (text.isSelected()) {							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.setAttachment(sb.toString());						} else {							File dir = new File(System.getProperty("user.dir"));							//  setup the temp file name							String tempFile = "tn5250jTemp";							try {								// create the temporary file								File f =									File.createTempFile(tempFile, ".png", dir);								System.out.println(f.getName());								System.out.println(f.getCanonicalPath());								// set it to delete on exit								f.deleteOnExit();								EncodeComponent.encode(									EncodeComponent.PNG,									session,									f);								sem.setFileName(f.getName());							} catch (Exception ex) {								System.out.println(ex.getMessage());							}						}						// send the information						sendIt(parent, sem);						sem.release();						sem = null;						break;					case 1 : // Cancel						//		      System.out.println("Cancel");						break;					case 2 : // Configure SMTP						configureSMTP(parent);						//		      System.out.println("Cancel");						break;					default :						break;				}			}		}	}