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;
}
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;
}
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);
}
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;
}
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);
}
Aggregations