XBayaLabel amiLabel = new XBayaLabel("AMI ID", this.amiTextField);
this.numberOfInstanceSpinner = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
XBayaLabel nInstanceLabel = new XBayaLabel("Number Of Instances", this.numberOfInstanceSpinner);
this.instanceTypeComboBox = new XBayaComboBox(new DefaultComboBoxModel(AmazonUtil.INSTANCE_TYPE));
this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
XBayaLabel instanceTypeLabel = new XBayaLabel("Instance Type", this.instanceTypeComboBox);
this.noKeyButton = new JRadioButton("No Key Pair");
this.noKeyButton.setSelected(true);
this.noKeyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent paramActionEvent) {
EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(false);
}
});
this.existKeyButton = new JRadioButton("Exist Key Pairs");
this.existKeyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent paramActionEvent) {
if (EC2LaunchWindow.this.keyComboBoxModel == null) {
EC2LaunchWindow.this.keyComboBoxModel = new DefaultComboBoxModel(AmazonUtil.loadKeypairs()
.toArray());
EC2LaunchWindow.this.keyComboBox.setModel(EC2LaunchWindow.this.keyComboBoxModel);
}
EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(true);
}
});
ButtonGroup serviceTypeButtonGroup = new ButtonGroup();
serviceTypeButtonGroup.add(this.noKeyButton);
serviceTypeButtonGroup.add(this.existKeyButton);
this.keyComboBox = new XBayaComboBox(new DefaultComboBoxModel());
this.keyComboBox.getJComboBox().setEnabled(false);
GridPanel radioPanel = new GridPanel();
radioPanel.add(this.noKeyButton);
radioPanel.add(new JPanel());