public WriteNewMail(User user, Mail mail) {
		this(new java.awt.Frame(), true);
		this.user = user;

		initComponents();
		addWindowListener(new java.awt.event.WindowAdapter() {
			public void windowClosing(java.awt.event.WindowEvent e) {
				dispose();
			}
		});
		if (mail != null) {
			this.mail = mail;
			toTextField.setText(mail.getTo());
			ccToTextField.setText(mail.getCc());
			BccTextField.setText(mail.getBcc());
			subjectTextField.setText(mail.getSubject());
			contentTextArea.setText(mail.getContent());
		}
		//˸ѡ
		fromComboBox.addItem(user.getUsername()
				+ "@"
				+ user.getSmtpServer().substring(
						user.getSmtpServer().indexOf(".") + 1));
		setLocation(340, 240);
		setVisible(true);
	}