attachmentName.setText("");
if (fileName != null || fileName.length() > 0) attachmentName.setText(fileName); else attachmentName.setText("");
	private JPanel setupMailPanel(String fileName) {		JPanel semp = new JPanel();		semp.setLayout(new GridBagLayout());		text = new JRadioButton(LangTool.getString("em.text"));		graphic = new JRadioButton(LangTool.getString("em.graphic"));		normal = new JRadioButton(LangTool.getString("em.normalmail"),true);		screenshot = new JRadioButton(LangTool.getString("em.screenshot"));		// Group the radio buttons.		ButtonGroup tGroup = new ButtonGroup();		tGroup.add(text);		tGroup.add(graphic);		ButtonGroup mGroup = new ButtonGroup();		mGroup.add(normal);		mGroup.add(screenshot);		text.setSelected(false);		text.setEnabled(false);		graphic.setEnabled(false);		JLabel screenDump = new JLabel(LangTool.getString("em.screendump"));		JLabel tol = new JLabel(LangTool.getString("em.to"));		JLabel subl = new JLabel(LangTool.getString("em.subject"));		JLabel bodyl = new JLabel(LangTool.getString("em.body"));		JLabel fnl = new JLabel(LangTool.getString("em.fileName"));		JLabel tom = new JLabel(LangTool.getString("em.typeofmail"));		browse = new JButton(LangTool.getString("em.choosefile"));		browse.addActionListener(new java.awt.event.ActionListener() {			public void actionPerformed(ActionEvent e) {				browse_actionPerformed(e);			}		});		toAddress = new JComboBox();		toAddress.setPreferredSize(new Dimension(175, 25));		toAddress.setEditable(true);		subject = new JTextField(30);		bodyText = new JTextArea(6, 30);		JScrollPane bodyScrollPane = new JScrollPane(bodyText);		bodyScrollPane.setHorizontalScrollBarPolicy(			JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);		bodyScrollPane.setVerticalScrollBarPolicy(			JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);		attachmentName = new JTextField(fileName, 30);		attachmentName.setText("");		text.addItemListener(new java.awt.event.ItemListener() {			public void itemStateChanged(java.awt.event.ItemEvent e) {				setAttachmentName();			}		});		normal.addItemListener(new java.awt.event.ItemListener() {			public void itemStateChanged(java.awt.event.ItemEvent e) {				setTypeOfMail();			}		});      if (sendScreen) {         screenshot.setSelected(true);      }      else {   		normal.setSelected(true);      }		config = null;		if (session != null) {			config = session.getConfiguration();			if (config.isPropertyExists("emailTo")) {				setToCombo(config.getStringProperty("emailTo"), toAddress);			}		}		semp.setBorder(BorderFactory.createEtchedBorder());		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 0;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 10, 5, 5);		semp.add(tom, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 0;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 15, 5, 5);		semp.add(normal, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 2; gbc.gridy = 0;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 45, 5, 10);		semp.add(screenshot, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 1;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(0, 10, 5, 5);		semp.add(screenDump, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 1;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(0, 15, 5, 5);		semp.add(text, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 2; gbc.gridy = 1;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(0, 45, 5, 10);		semp.add(graphic, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 2;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 10, 5, 5);		semp.add(tol, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 2;		gbc.gridwidth = 2;		gbc.fill = GridBagConstraints.HORIZONTAL;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 5, 5, 10);		semp.add(toAddress, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 3;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 10, 5, 5);		semp.add(subl, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 3;		gbc.gridwidth = 2;        gbc.fill = GridBagConstraints.HORIZONTAL;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 5, 5, 10);		semp.add(subject, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 4;		gbc.gridheight = 3;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 10, 5, 5);		semp.add(bodyl, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 4;		gbc.gridwidth = 2; gbc.gridheight = 3;        gbc.fill = GridBagConstraints.HORIZONTAL;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 5, 5, 10);		semp.add(bodyScrollPane, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 0; gbc.gridy = 7;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 10, 5, 5);		semp.add(fnl, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 7;		gbc.gridwidth = 2;        gbc.fill = GridBagConstraints.HORIZONTAL;		gbc.anchor = GridBagConstraints.WEST;		gbc.insets = new Insets(5, 5, 5, 10);		semp.add(attachmentName, gbc);		gbc = new GridBagConstraints();		gbc.gridx = 1; gbc.gridy = 8;		gbc.gridwidth = 2;		gbc.anchor = GridBagConstraints.CENTER;		gbc.insets = new Insets(5, 5, 10, 10);		semp.add(browse, gbc);		return semp;	}