private void initComponents() {
    productNameLabel = new JLabel("Name: ");
    productNameTextField = new JTextField(25);
    saveToFileCheckBox = new JCheckBox("Save as:");
    productDirLabel = new JLabel("Directory:");
    productDirTextField = new JTextField(25);
    productDirChooserButton = new JButton(new ProductDirChooserAction());
    formatNameComboBox = new JComboBox(model.getFormatNames());
    openInAppCheckBox = new JCheckBox("Open in application");

    final Dimension size = new Dimension(26, 16);
    productDirChooserButton.setPreferredSize(size);
    productDirChooserButton.setMinimumSize(size);
    saveToFileCheckBox.addActionListener(new UIStateUpdater());
    formatNameComboBox.addItemListener(
        new ItemListener() {
          @Override
          public void itemStateChanged(ItemEvent e) {
            final String formatName = (String) formatNameComboBox.getSelectedItem();
            if (!canReadOutputFormat(formatName)) {
              model.setOpenInAppSelected(false);
            }
          }
        });
  }
示例#2
0
  private void initComponents() {
    productNameLabel = new JLabel("Name: ");
    productNameTextField = new JTextField(25);
    productDirLabel = new JLabel("Directory:");
    productDirTextField = new JTextField(25);
    productDirChooserButton = new JButton(new ProductDirChooserAction());

    final Dimension size = new Dimension(26, 16);
    productDirChooserButton.setPreferredSize(size);
    productDirChooserButton.setMinimumSize(size);

    if (!alwaysWriteOutput) {
      saveToFileCheckBox = new JCheckBox("Save as:");
      formatNameComboBox = new JComboBox<>(model.getFormatNames());
      openInAppCheckBox = new JCheckBox("Open in application");
    }
  }