use of javax.swing.DefaultComboBoxModel in project jmeter by apache.
the class HtmlExtractorGui method makeExtractorPanel.
private Component makeExtractorPanel() {
JPanel panel = new HorizontalPanel();
//$NON-NLS-1$
panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("html_extractor_type")));
DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();
for (String s : HtmlExtractor.getImplementations()) {
m.addElement(s);
}
m.addElement(USE_DEFAULT_EXTRACTOR_IMPL);
extractorImplName = new JComboBox<>(m);
extractorImplName.setSelectedItem(HtmlExtractor.DEFAULT_EXTRACTOR);
// $NON-NLS-1$
JLabel label2 = new JLabel(JMeterUtils.getResString("html_extractor_type"));
label2.setLabelFor(extractorImplName);
panel.add(label2);
panel.add(extractorImplName);
return panel;
}
use of javax.swing.DefaultComboBoxModel in project jmeter by apache.
the class ThroughputControllerGui 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());
DefaultComboBoxModel<String> styleModel = new DefaultComboBoxModel<>();
styleModel.addElement(BYNUMBER_LABEL);
styleModel.addElement(BYPERCENT_LABEL);
styleBox = new JComboBox<>(styleModel);
styleBox.addActionListener(evt -> {
if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) {
style = ThroughputController.BYNUMBER;
} else {
style = ThroughputController.BYPERCENT;
}
});
add(styleBox);
// TYPE FIELD
JPanel tpPanel = new JPanel();
JLabel tpLabel = new JLabel(THROUGHPUT_LABEL);
tpPanel.add(tpLabel);
// TEXT FIELD
throughput = new JTextField(15);
tpPanel.add(throughput);
// $NON-NLS-1$
throughput.setText("1");
tpPanel.add(throughput);
add(tpPanel);
// PERTHREAD FIELD
perthread = new JCheckBox(PERTHREAD_LABEL, isPerThread);
perthread.addItemListener(evt -> {
if (evt.getStateChange() == ItemEvent.SELECTED) {
isPerThread = true;
} else {
isPerThread = false;
}
});
add(CheckBoxPanel.wrap(perthread));
}
use of javax.swing.DefaultComboBoxModel in project jgnash by ccavanaugh.
the class InvestmentTransactionPanel method initComponents.
private void initComponents() {
actionCombo = new JComboBox<>(new DefaultComboBoxModel<>(actions));
cardPanel = new JPanel();
cardPanel.setLayout(new CardLayout());
enterButton = new JButton(rb.getString("Button.Enter"));
cancelButton = new JButton(rb.getString("Button.Cancel"));
cancelButton.addActionListener(this);
enterButton.addActionListener(this);
actionCombo.addActionListener(this);
}
Aggregations