diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/requestpanel/paramfield/DataProductTypeField.java b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/requestpanel/paramfield/DataProductTypeField.java index 7fd4e5c..ef1ce6d 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/requestpanel/paramfield/DataProductTypeField.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/requestpanel/paramfield/DataProductTypeField.java @@ -52,20 +52,30 @@ public class DataProductTypeField extends ParamField { */ public DataProductTypeField(ViewListener viewListener, String paramName) { super(viewListener, paramName); - comboBox = new JComboBox<>(DataProductType.values()); - comboBox.setSelectedItem(DataProductType.ALL); - comboBox.setPreferredSize( - new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT)); - - comboBox.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - update(); - } - }); + this.add(getComboBox()); + } - this.add(comboBox); + /** + * @return + * + */ + public JComboBox getComboBox() { + if (comboBox == null) { + comboBox = new JComboBox<>(DataProductType.values()); + comboBox.setSelectedItem(DataProductType.ALL); + comboBox.setPreferredSize( + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT)); + + comboBox.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + update(); + } + }); + } + + return comboBox; } /** -- libgit2 0.21.2