// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: MainClass.java
package mail;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.*;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
// Referenced classes of package mail:
// SendMail, Configer, MailTest, MimeFinder
public class MainClass
{
private ArrayList delLinkmans;
private ArrayList delFiles;
private Configer config1;
private Configer config2;
private String sender;
private String password;
private String fakeSender;
private String subject;
private String receiver;
private String message;
private ArrayList attachment;
private File bgImage;
JFrame frame;
JLabel senderLabel;
JLabel passwordLabel;
JLabel subjectLabel;
JLabel fakeSenderLabel;
JLabel receiverLabel;
JLabel addFileLabel;
JLabel attachmentLabel;
JLabel receiverListLabel;
JLabel statusBar;
JTextField senderField;
JPasswordField passwordField;
JTextField fakeSenderField;
JTextField subjectField;
JTextField receiverField;
JTextField addFileField;
JTextArea ma;
JScrollPane sp;
JButton addReceiverButton;
JButton delReceiverButton;
JButton addFileButton;
JButton delFileButton;
JButton browseButton;
JButton sendButton;
JButton qqButton;
JCheckBox saveUP;
JCheckBox isPictureBg;
DefaultListModel receiversListModel;
DefaultListModel filesListModel;
JList receiversList;
JList filesList;
JScrollPane rp;
JScrollPane fp;
public MainClass()
{
delLinkmans = new ArrayList();
delFiles = new ArrayList();
config1 = null;
config2 = null;
sender = null;
password = null;
fakeSender = null;
subject = null;
receiver = null;
message = null;
attachment = new ArrayList();
bgImage = null;
frame = new JFrame("JavaMailSender QQ:5677392");
senderLabel = new JLabel("发信邮箱:");
passwordLabel = new JLabel("密码:");
subjectLabel = new JLabel("主题:");
fakeSenderLabel = new JLabel("个人签名:");
receiverLabel = new JLabel("收信人");
addFileLabel = new JLabel("添加附件:");
attachmentLabel = new JLabel("附件列表:");
receiverListLabel = new JLabel("联系人列表:");
statusBar = new JLabel("");
senderField = new JTextField();
passwordField = new JPasswordField();
fakeSenderField = new JTextField();
subjectField = new JTextField();
receiverField = new JTextField();
addFileField = new JTextField();
ma = new JTextArea(100, 100);
sp = new JScrollPane(ma);
addReceiverButton = new JButton("添加到联系人列表");
delReceiverButton = new JButton("删除所选联系人");
addFileButton = new JButton("添加到附件列表");
delFileButton = new JButton("删除所选附件");
browseButton = new JButton("浏览");
sendButton = new JButton("发送");
qqButton = new JButton("QMe");
saveUP = new JCheckBox("保存用户名和密码");
isPictureBg = new JCheckBox("用图片作背景");
receiversListModel = new DefaultListModel();
filesListModel = new DefaultListModel();
receiversList = new JList(receiversListModel);
filesList = new JList(filesListModel);
rp = new JScrollPane(receiversList);
fp = new JScrollPane(filesList);
}
public ArrayList getAttachment()
{
return attachment;
}
public void setAttachment(ArrayList attachment)
{
this.attachment = attachment;
}
public File getBgImage()
{
return bgImage;
}
public void setBgImage(File bgImage)
{
this.bgImage = bgImage;
}
public String getFakeSender()
{
return fakeSender;
}
public void setFakeSender(String fakeSender)
{
this.fakeSender = fakeSender;
}
public String getMessage()
{
return message;
}
public void setMessage(String message)
{
this.message = message;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getSender()
{
return sender;
}
public void setSender(String sender)
{
this.sender = sender;
}
public String getSubject()
{
return subject;
}
public void setSubject(String subject)
{
this.subject = subject;
}
public String getReceiver()
{
return receiver;
}
public void setReceiver(String receiver)
{
this.receiver = receiver;
}
public void init()
{
SendMail sm = new SendMail();
try
{
config1 = new Configer("c:\\windows\\system32\\mailconfig", "linkmans.ini");
File linkmnaFile = config1.getConfigFile();
config2 = new Configer(linkmnaFile.getParent(), "up.ini");
File passwordFile = config2.getConfigFile();
if(linkmnaFile.length() != 0L)
{
config1.readConfig(linkmnaFile);
ArrayList list = config1.getConfig();
Object mans[] = list.toArray();
for(int i = 0; i < mans.length; i++)
receiversListModel.addElement(mans[i]);
}
if(passwordFile.length() != 0L)
{
config2.readConfig(passwordFile);
ArrayList list = config2.getConfig();
Object up[] = list.toArray();
System.out.println("upList" + list.size());
setSender((String)up[0]);
setPassword((String)up[1]);
senderField.setText((String)up[0]);
passwordField.setText((String)up[1]);
saveUP.setSelected(true);
}
}
catch(Exception e)
{
e.printStackTrace();
}
javax.swing.border.Border fieldBorder = BorderFactory.createBevelBorder(1);
javax.swing.border.Border panelBorder1 = BorderFactory.createLineBorder(Color.GRAY, 1);
javax.swing.border.Border panelBorder2 = BorderFactory.createTitledBorder("邮件正文");
senderLabel.setSize(60, 20);
passwordLabel.setSize(60, 20);
fakeSenderLabel.setSize(60, 20);
subjectLabel.setSize(60, 20);
addFileLabel.setSize(110, 20);
receiverLabel.setSize(110, 20);
attachmentLabel.setSize(150, 20);
receiverListLabel.setSize(110, 20);
senderField.setBorder(fieldBorder);
passwordField.setBorder(fieldBorder);
subjectField.setBorder(fieldBorder);
receiverField.setBorder(fieldBorder);
addFileField.setBorder(fieldBorder);
ma.setBorder(fieldBorder);
fakeSenderField.setBorder(fieldBorder);
ma.setLineWrap(true);
passwordField.setSize(300, 20);
senderField.setSize(300, 20);
subjectField.setSize(300, 20);
fakeSenderField.setSize(300, 20);
receiverField.setSize(260, 20);
addFileField.setSize(195, 20);
sendButton.setSize(180, 30);
qqButton.setSize(75, 30);
addReceiverButton.setSize(145, 20);
delReceiverButton.setSize(145, 20);
addF