c = new GridBagConstraints();
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(5, 5, 5, 5);
resultPanel.add(resultValueField, c);
JButton addResultButton = new JButton("Add");
addResultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addResult();
}
});
c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(5, 5, 5, 5);
resultPanel.add(addResultButton, c);
resultList = new JList();
resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
resultList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
removeResultButton.setEnabled(resultList.getSelectedIndex() != -1);
}
});
c = new GridBagConstraints();
c.gridy = 1;
c.gridwidth = 4;
c.weightx = 1;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(5, 5, 5, 5);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(resultList);
resultPanel.add(scrollPane, c);
removeResultButton = new JButton("Remove");
removeResultButton.setEnabled(false);
removeResultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
removeResult();
}
});
c = new GridBagConstraints();
c.gridy = 1;
c.anchor = GridBagConstraints.NORTH;
c.insets = new Insets(5, 5, 5, 5);
resultPanel.add(removeResultButton, c);
c = new GridBagConstraints();
c.gridy = 3 + additionalParameters;
c.gridwidth = 2;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
panel.add(resultPanel, c);
// Buttom Panel
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new GridBagLayout());
completeButton = new JButton("Complete");
completeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
complete();
}
});
c = new GridBagConstraints();
c.weightx = 1;
c.anchor = GridBagConstraints.EAST;
c.insets = new Insets(5, 5, 5, 5);
bottomPanel.add(completeButton, c);
abortButton = new JButton("Abort");
abortButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
abort();
}
});