}
});
frame.setLocationRelativeTo(null);
frame.setSize(551, 427);
frame.add(panelTop);
SpringLayout sl_panelTop = new SpringLayout();
panelTop.setLayout(sl_panelTop);
JLabel lblUsr = new JLabel("用户id");
sl_panelTop.putConstraint(SpringLayout.NORTH, lblUsr, 10, SpringLayout.NORTH, panelTop);
lblUsr.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(lblUsr);
JLabel lblPwd = new JLabel("密码");
sl_panelTop.putConstraint(SpringLayout.WEST, lblPwd, 10, SpringLayout.WEST, panelTop);
lblPwd.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(lblPwd);
JLabel lblFileNmae = new JLabel("存储路径");
sl_panelTop.putConstraint(SpringLayout.NORTH, lblFileNmae, 54, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.SOUTH, lblPwd, -6, SpringLayout.NORTH, lblFileNmae);
sl_panelTop.putConstraint(SpringLayout.WEST, lblFileNmae, 10, SpringLayout.WEST, panelTop);
lblFileNmae.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(lblFileNmae);
JLabel lblFileType = new JLabel("文件格式");
sl_panelTop.putConstraint(SpringLayout.NORTH, lblFileType, 83, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.WEST, lblFileType, 10, SpringLayout.WEST, panelTop);
lblFileType.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(lblFileType);
txtUsr = new JTextField();
sl_panelTop.putConstraint(SpringLayout.EAST, lblUsr, -28, SpringLayout.WEST, txtUsr);
sl_panelTop.putConstraint(SpringLayout.NORTH, txtUsr, 7, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.WEST, txtUsr, 80, SpringLayout.WEST, panelTop);
sl_panelTop.putConstraint(SpringLayout.EAST, txtUsr, -10, SpringLayout.EAST, panelTop);
panelTop.add(txtUsr);
txtUsr.setColumns(10);
txtPwd = new JTextField();
sl_panelTop.putConstraint(SpringLayout.EAST, txtPwd, 0, SpringLayout.EAST, txtUsr);
sl_panelTop.putConstraint(SpringLayout.SOUTH, txtUsr, -1, SpringLayout.NORTH, txtPwd);
sl_panelTop.putConstraint(SpringLayout.NORTH, txtPwd, -2, SpringLayout.NORTH, lblPwd);
sl_panelTop.putConstraint(SpringLayout.WEST, txtPwd, 42, SpringLayout.EAST, lblPwd);
panelTop.add(txtPwd);
txtPwd.setColumns(10);
txtFilePath = new JTextField();
sl_panelTop.putConstraint(SpringLayout.NORTH, txtFilePath, 3, SpringLayout.SOUTH, txtPwd);
sl_panelTop.putConstraint(SpringLayout.WEST, txtFilePath, 0, SpringLayout.WEST, txtUsr);
panelTop.add(txtFilePath);
txtFilePath.setColumns(10);
String dir = System.getProperty("user.dir");
txtFilePath.setText(dir);
rdbtnCSV = new JRadioButton(".csv");
sl_panelTop.putConstraint(SpringLayout.SOUTH, rdbtnCSV, -295, SpringLayout.SOUTH, panelTop);
rdbtnCSV.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0)
{
onRadioButtonClick(1);
}
});
JButton btnBrowse = new JButton("浏览");
btnBrowse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
JFileChooser chooser = new JFileChooser(txtFilePath.getText());
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int r = chooser.showOpenDialog(null);
if(r == JFileChooser.APPROVE_OPTION)
{
File f = chooser.getSelectedFile();
txtFilePath.setText(f.getPath());
}
}
});
sl_panelTop.putConstraint(SpringLayout.EAST, txtFilePath, -6, SpringLayout.WEST, btnBrowse);
sl_panelTop.putConstraint(SpringLayout.NORTH, btnBrowse, -2, SpringLayout.NORTH, lblFileNmae);
sl_panelTop.putConstraint(SpringLayout.EAST, btnBrowse, 0, SpringLayout.EAST, txtUsr);
panelTop.add(btnBrowse);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnCSV, 14, SpringLayout.EAST, lblFileType);
rdbtnCSV.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(rdbtnCSV);
rdbtnXML = new JRadioButton(".xml");
rdbtnXML.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onRadioButtonClick(2);
}
});
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnXML, -4, SpringLayout.NORTH, lblFileType);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnXML, 6, SpringLayout.EAST, rdbtnCSV);
rdbtnXML.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(rdbtnXML);
rdbtnHTML = new JRadioButton(".html");
rdbtnHTML.setSelected(true);
rdbtnHTML.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0)
{
onRadioButtonClick(3);
}
});
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnHTML, -3, SpringLayout.NORTH, lblFileType);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnHTML, 6, SpringLayout.EAST, rdbtnXML);
rdbtnHTML.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(rdbtnHTML);
rdbtnTXT = new JRadioButton(".txt");
rdbtnTXT.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0)
{
onRadioButtonClick(4);
}
});
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnTXT, -3, SpringLayout.NORTH, lblFileType);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnTXT, 6, SpringLayout.EAST, rdbtnHTML);
rdbtnTXT.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(rdbtnTXT);
buttongroup = new ButtonGroup();
buttongroup.add(rdbtnCSV);
buttongroup.add(rdbtnXML);
buttongroup.add(rdbtnHTML);
buttongroup.add(rdbtnTXT);
btnStart = new JButton("开始");
sl_panelTop.putConstraint(SpringLayout.WEST, btnStart, 0, SpringLayout.WEST, lblUsr);
btnStart.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onStartButtonClick();
}
});
panelTop.add(btnStart);
txtLog = new JTextArea();
txtLog.setText("饭否消息导出工具 v2.4.0\r\n发布日期:2012年10月7日\r\n作者:@烽麒\r\n网站:http://fq.vc\r\n");
txtLog.setEditable(false);
JScrollPane scroll = new JScrollPane(txtLog);
sl_panelTop.putConstraint(SpringLayout.SOUTH, btnStart, -6, SpringLayout.NORTH, scroll);
sl_panelTop.putConstraint(SpringLayout.NORTH, scroll, 166, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.SOUTH, scroll, -10, SpringLayout.SOUTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.WEST, scroll, 0, SpringLayout.WEST, lblUsr);
sl_panelTop.putConstraint(SpringLayout.EAST, scroll, 0, SpringLayout.EAST, txtUsr);
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
panelTop.add(scroll);
chkbxPic = new JCheckBox("导出图片");
sl_panelTop.putConstraint(SpringLayout.NORTH, chkbxPic, -4, SpringLayout.NORTH, lblFileType);
sl_panelTop.putConstraint(SpringLayout.WEST, chkbxPic, 6, SpringLayout.EAST, rdbtnTXT);
chkbxPic.setSelected(true);
chkbxPic.setEnabled(false);
chkbxPic.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(chkbxPic);
JLabel lblExpType = new JLabel("导出内容");
sl_panelTop.putConstraint(SpringLayout.NORTH, lblExpType, 108, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.EAST, lblExpType, 0, SpringLayout.EAST, lblFileType);
lblExpType.setFont(new Font("宋体", Font.PLAIN, 14));
panelTop.add(lblExpType);
rdbtnUsrTL = new JRadioButton("已发消息");
rdbtnUsrTL.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onRadioButton2Click(1);
}
});
rdbtnUsrTL.setSelected(true);
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnUsrTL, 105, SpringLayout.NORTH, panelTop);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnUsrTL, 0, SpringLayout.WEST, txtUsr);
rdbtnUsrTL.setFont(new Font("宋体", Font.PLAIN, 12));
panelTop.add(rdbtnUsrTL);
rdbtnMention = new JRadioButton("@提到我的消息");
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnMention, 0, SpringLayout.SOUTH, rdbtnHTML);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnMention, 0, SpringLayout.EAST, rdbtnUsrTL);
rdbtnMention.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onRadioButton2Click(2);
}
});
rdbtnMention.setFont(new Font("宋体", Font.PLAIN, 12));
panelTop.add(rdbtnMention);
rdbtnDM = new JRadioButton("私信");
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnDM, 0, SpringLayout.SOUTH, rdbtnHTML);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnDM, 102, SpringLayout.EAST, rdbtnUsrTL);
rdbtnDM.setEnabled(false);
rdbtnDM.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onRadioButton2Click(3);
}
});
rdbtnDM.setFont(new Font("宋体", Font.PLAIN, 12));
panelTop.add(rdbtnDM);
rdbtnFav = new JRadioButton("收藏");
rdbtnFav.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0)
{
onRadioButton2Click(5);
}
});
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnFav, -3, SpringLayout.NORTH, lblExpType);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnFav, 0, SpringLayout.EAST, rdbtnDM);
rdbtnFav.setFont(new Font("宋体", Font.PLAIN, 12));
panelTop.add(rdbtnFav);
rdbtnFriTL = new JRadioButton("指定好友已发消息");
sl_panelTop.putConstraint(SpringLayout.NORTH, rdbtnFriTL, -3, SpringLayout.NORTH, lblExpType);
sl_panelTop.putConstraint(SpringLayout.WEST, rdbtnFriTL, 0, SpringLayout.EAST, rdbtnFav);
rdbtnFriTL.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
onRadioButton2Click(4);
}
});
rdbtnFriTL.setFont(new Font("宋体", Font.PLAIN, 12));
panelTop.add(rdbtnFriTL);
buttongroup2 = new ButtonGroup();
buttongroup2.add(rdbtnUsrTL);
buttongroup2.add(rdbtnMention);
buttongroup2.add(rdbtnDM);
buttongroup2.add(rdbtnFriTL);
buttongroup2.add(rdbtnFav);
txtFriID = new JTextField();
sl_panelTop.putConstraint(SpringLayout.NORTH, txtFriID, -2, SpringLayout.NORTH, lblExpType);
sl_panelTop.putConstraint(SpringLayout.WEST, txtFriID, 121, SpringLayout.EAST, rdbtnFav);
sl_panelTop.putConstraint(SpringLayout.EAST, txtFriID, 0, SpringLayout.EAST, txtUsr);
txtFriID.setEnabled(false);
txtFriID.setText("好友ID");
txtFriID.setToolTipText("好友ID");
panelTop.add(txtFriID);
txtFriID.setColumns(10);