Search in sources :

Example 76 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class ServerPanel method getConnectTimeOutPanel.

private JPanel getConnectTimeOutPanel() {
    connectTimeOut = new JTextField(4);
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("web_server_timeout_connect"));
    label.setLabelFor(connectTimeOut);
    JPanel panel = new JPanel(new BorderLayout(5, 0));
    panel.add(label, BorderLayout.WEST);
    panel.add(connectTimeOut, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 77 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class ServerPanel method getResponseTimeOutPanel.

private JPanel getResponseTimeOutPanel() {
    responseTimeOut = new JTextField(4);
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("web_server_timeout_response"));
    label.setLabelFor(responseTimeOut);
    JPanel panel = new JPanel(new BorderLayout(5, 0));
    panel.add(label, BorderLayout.WEST);
    panel.add(responseTimeOut, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 78 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class ThreadGroupGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    // THREAD PROPERTIES
    VerticalPanel threadPropsPanel = new VerticalPanel();
    threadPropsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("thread_properties")));
    // NUMBER OF THREADS
    JPanel threadPanel = new JPanel(new BorderLayout(5, 0));
    // $NON-NLS-1$
    JLabel threadLabel = new JLabel(JMeterUtils.getResString("number_of_threads"));
    threadPanel.add(threadLabel, BorderLayout.WEST);
    threadInput = new JTextField(5);
    threadInput.setName(THREAD_NAME);
    threadLabel.setLabelFor(threadInput);
    threadPanel.add(threadInput, BorderLayout.CENTER);
    threadPropsPanel.add(threadPanel);
    // RAMP-UP
    JPanel rampPanel = new JPanel(new BorderLayout(5, 0));
    // $NON-NLS-1$
    JLabel rampLabel = new JLabel(JMeterUtils.getResString("ramp_up"));
    rampPanel.add(rampLabel, BorderLayout.WEST);
    rampInput = new JTextField(5);
    rampInput.setName(RAMP_NAME);
    rampLabel.setLabelFor(rampInput);
    rampPanel.add(rampInput, BorderLayout.CENTER);
    threadPropsPanel.add(rampPanel);
    // LOOP COUNT
    threadPropsPanel.add(createControllerPanel());
    if (showDelayedStart) {
        // $NON-NLS-1$
        delayedStart = new JCheckBox(JMeterUtils.getResString("delayed_start"));
        threadPropsPanel.add(delayedStart);
    }
    // $NON-NLS-1$
    scheduler = new JCheckBox(JMeterUtils.getResString("scheduler"));
    scheduler.addItemListener(this);
    threadPropsPanel.add(scheduler);
    mainPanel = new VerticalPanel();
    mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("scheduler_configuration")));
    mainPanel.add(createDurationPanel());
    mainPanel.add(createDelayPanel());
    mainPanel.add(createStartTimePanel());
    mainPanel.add(createEndTimePanel());
    toggleSchedulerFields(false);
    VerticalPanel intgrationPanel = new VerticalPanel();
    intgrationPanel.add(threadPropsPanel);
    intgrationPanel.add(mainPanel);
    add(intgrationPanel, BorderLayout.CENTER);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 79 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class ThreadGroupGui method createDurationPanel.

/**
     * Create a panel containing the Duration field and corresponding label.
     *
     * @return a GUI panel containing the Duration field
     */
private JPanel createDurationPanel() {
    JPanel panel = new JPanel(new BorderLayout(5, 0));
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("duration"));
    panel.add(label, BorderLayout.WEST);
    duration = new JTextField();
    panel.add(duration, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 80 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class TestActionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    // Target
    HorizontalPanel targetPanel = new HorizontalPanel();
    targetPanel.add(new JLabel(targetLabel));
    DefaultComboBoxModel<String> targetModel = new DefaultComboBoxModel<>();
    targetModel.addElement(threadTarget);
    targetModel.addElement(testTarget);
    targetBox = new JComboBox<>(targetModel);
    targetBox.addActionListener(evt -> {
        if (((String) targetBox.getSelectedItem()).equals(threadTarget)) {
            target = TestAction.THREAD;
        } else {
            target = TestAction.TEST;
        }
    });
    targetPanel.add(targetBox);
    add(targetPanel);
    // Action
    HorizontalPanel actionPanel = new HorizontalPanel();
    ButtonGroup actionButtons = new ButtonGroup();
    pauseButton = new JRadioButton(pauseAction, true);
    pauseButton.addChangeListener(evt -> {
        if (pauseButton.isSelected()) {
            action = TestAction.PAUSE;
            durationField.setEnabled(true);
            targetBox.setEnabled(true);
        }
    });
    stopButton = new JRadioButton(stopAction, false);
    stopButton.addChangeListener(evt -> {
        if (stopButton.isSelected()) {
            action = TestAction.STOP;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    stopNowButton = new JRadioButton(stopNowAction, false);
    stopNowButton.addChangeListener(evt -> {
        if (stopNowButton.isSelected()) {
            action = TestAction.STOP_NOW;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    restartNextLoopButton = new JRadioButton(restartNextLoopAction, false);
    restartNextLoopButton.addChangeListener(evt -> {
        if (restartNextLoopButton.isSelected()) {
            action = TestAction.RESTART_NEXT_LOOP;
            durationField.setEnabled(false);
            targetBox.setSelectedIndex(TestAction.THREAD);
            targetBox.setEnabled(false);
        }
    });
    actionButtons.add(pauseButton);
    actionButtons.add(stopButton);
    actionButtons.add(stopNowButton);
    actionButtons.add(restartNextLoopButton);
    actionPanel.add(new JLabel(actionLabel));
    actionPanel.add(pauseButton);
    actionPanel.add(stopButton);
    actionPanel.add(stopNowButton);
    actionPanel.add(restartNextLoopButton);
    add(actionPanel);
    // Duration
    HorizontalPanel durationPanel = new HorizontalPanel();
    durationField = new JTextField(15);
    // $NON-NLS-1$
    durationField.setText("");
    durationPanel.add(new JLabel(durationLabel));
    durationPanel.add(durationField);
    add(durationPanel);
}
Also used : JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) JTextField(javax.swing.JTextField)

Aggregations

JTextField (javax.swing.JTextField)450 JLabel (javax.swing.JLabel)270 JPanel (javax.swing.JPanel)236 JButton (javax.swing.JButton)135 BorderLayout (java.awt.BorderLayout)115 GridBagLayout (java.awt.GridBagLayout)94 Insets (java.awt.Insets)94 GridBagConstraints (java.awt.GridBagConstraints)93 Dimension (java.awt.Dimension)91 JCheckBox (javax.swing.JCheckBox)89 ActionEvent (java.awt.event.ActionEvent)84 ActionListener (java.awt.event.ActionListener)75 JScrollPane (javax.swing.JScrollPane)64 BoxLayout (javax.swing.BoxLayout)50 JTextArea (javax.swing.JTextArea)40 FlowLayout (java.awt.FlowLayout)39 JComboBox (javax.swing.JComboBox)39 JRadioButton (javax.swing.JRadioButton)37 ButtonGroup (javax.swing.ButtonGroup)35 JTable (javax.swing.JTable)34