⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frame1.java~24~

📁 自己用java开发的web压力测试工具
💻 JAVA~24~
字号:
package webpresstest;

import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class Frame1
    extends JFrame {
  JPanel contentPane;
  JTextField jTextField1 = new JTextField();
  JButton jButton1 = new JButton();
  JLabel jLabel1 = new JLabel();
  JTextField jTextField2 = new JTextField();
  XYLayout xYLayout1 = new XYLayout();
  public JLabel jLabel2 = new JLabel();
  public JLabel jLabel3 = new JLabel();
  JTextField jTextField3 = new JTextField();
  JScrollPane jScrollPane1 = new JScrollPane();
  JLabel jLabel4 = new JLabel();
  JComboBox jComboBox1 = new JComboBox();
  JLabel jLabel5 = new JLabel();
  JScrollPane jScrollPane2 = new JScrollPane();
  JTextPane jTextPane2 = new JTextPane();
  JTextArea jTextArea1 = new JTextArea();
  JTextArea jTextArea2 = new JTextArea();
  JLabel jLabel6 = new JLabel();
  JLabel jLabel7 = new JLabel();
  JLabel jLabel8 = new JLabel();
  JLabel jLabel9 = new JLabel();
  JLabel jLabel10 = new JLabel();
  JTextArea jTextArea3 = new JTextArea();
  JLabel jLabel11 = new JLabel();
  JLabel jLabel12 = new JLabel();
  JLabel jLabel13 = new JLabel();
  public Frame1() {
    try {
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      jbInit();
    }
    catch (Exception exception) {
      exception.printStackTrace();
    }
  }

  /**
   * Component initialization.
   *
   * @throws java.lang.Exception
   */
  private void jbInit() throws Exception {
    contentPane = (JPanel) getContentPane();
    contentPane.setLayout(xYLayout1);
    setSize(new Dimension(631, 587));
    setTitle("Frame Title");
    jButton1.setText("启动");
    jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
    jLabel1.setText("URL:");
    jLabel2.setText("线程数");
    jTextField2.setText("10");
    jLabel3.setText("重复数");
    jTextField3.setText("10");
    jLabel4.setText("post内容");
    jScrollPane1.setAutoscrolls(true);
    jLabel5.setText("方式:");
    jScrollPane2.setAutoscrolls(true);
    jLabel6.setText("返回内容");
    jLabel7.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel7.setForeground(Color.red);
    jLabel7.setText("开始时间:");
    jLabel8.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel8.setForeground(Color.red);
    jLabel8.setText("最后时间:");
    jLabel9.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel9.setForeground(Color.red);
    jLabel9.setLabelFor(null);
    jLabel9.setText("消耗时间(ms):");
    jLabel10.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel10.setForeground(Color.red);
    jLabel10.setToolTipText("");
    jLabel10.setText("已完成:");
    jTextArea3.setText("jTextArea3");
    jLabel11.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel11.setForeground(Color.red);
    jLabel11.setText("Sucess:");
    jLabel12.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel12.setForeground(Color.red);
    jLabel12.setText("ERROR:");
    jLabel13.setFont(new java.awt.Font("Dialog", Font.BOLD, 16));
    jLabel13.setForeground(Color.red);
    jLabel13.setText("返回字节:");
    contentPane.add(jLabel3, new XYConstraints(179, 65, -1, -1));
    contentPane.add(jLabel1, new XYConstraints(5, 30, 100, 26));
    contentPane.add(jLabel4, new XYConstraints(11, 95, 209, -1));
    contentPane.add(jScrollPane1, new XYConstraints(10, 116, 591, 161));
    jScrollPane1.getViewport().add(jTextArea2);
    contentPane.add(jScrollPane2, new XYConstraints(11, 299, 591, 167));
    jScrollPane2.getViewport().add(jTextArea3);
    contentPane.add(jTextField1, new XYConstraints(61, 30, 418, -1));
    contentPane.add(jComboBox1, new XYConstraints(400, 62, 80, 21));
    contentPane.add(jLabel5, new XYConstraints(354, 66, -1, -1));
    contentPane.add(jLabel6, new XYConstraints(10, 280, 106, 18));
    contentPane.add(jTextField2, new XYConstraints(61, 61, 95, 21));
    contentPane.add(jTextField3, new XYConstraints(235, 63, 93, -1));
    contentPane.add(jLabel2, new XYConstraints(8, 63, -1, -1));
    contentPane.add(jLabel10, new XYConstraints(312, 473, 137, 31));
    contentPane.add(jLabel12, new XYConstraints(312, 526, 137, 31));
    contentPane.add(jLabel7, new XYConstraints(13, 473, 271, 31));
    contentPane.add(jLabel8, new XYConstraints(13, 499, 268, 31));
    contentPane.add(jLabel11, new XYConstraints(13, 526, 278, 31));
    contentPane.add(jLabel13, new XYConstraints(478, 478, 126, -1));
    contentPane.add(jLabel9, new XYConstraints(312, 499, 249, 31));
    contentPane.add(jButton1, new XYConstraints(502, 28, 100, 38));
    jComboBox1.addItem("get");
    jComboBox1.addItem("post");

  }

  public void jButton1_actionPerformed(ActionEvent e) {
    TestThread.begin=null;
    TestThread.success=0;
    TestThread.error=0;

    TestThread[] kk;
    for (int i=0;i<Integer.parseInt(jTextField2.getText());i++){
      TestThread k=new TestThread(i,this);
      k.start();
      }
  }
}

class Frame1_jButton1_actionAdapter
    implements ActionListener {
  private Frame1 adaptee;
  Frame1_jButton1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -