1 | removeButton.addActionListener(new ActionListener() {↵ | | 1 | removeButton.addActionListener(new ActionListener() {↵
|
2 | public void actionPerformed(ActionEvent e) {↵ | | 2 | public void actionPerformed(ActionEvent e) {↵
|
3 | remove(index);↵ | | 3 | remove(index);↵
|
4 | }↵ | | 4 | }↵
|
5 | });↵ | | 5 | });↵
|
|
| | | 6 | /*↵
|
| | | 7 | * c.gridx = GridBagConstraints.REMAINDER; c.anchor =↵
|
| | | 8 | * GridBagConstraints.NORTHEAST; gridbag.setConstraints(↵
|
| | | 9 | * removeButton, c ); panel.add( removeButton );↵
|
| | | 10 | */↵
|
6 | JPanel buttonPanel = new JPanel();↵ | | 11 | JPanel buttonPanel = new JPanel();↵
|
7 | buttonPanel.setLayout(new GridLayout(0, 2, 2, 2));↵ | | 12 | buttonPanel.setLayout(new GridLayout(0, 2, 2, 2));↵
|
8 | buttonPanel.add(removeButton);↵ | | 13 | buttonPanel.add(removeButton);↵
|
9 | buttonPanel.add(addButton);↵ | | 14 | buttonPanel.add(addButton);↵
|
|
10 | c.insets = new Insets(2, 2, 2, 2);↵ | | 15 | c.insets = new Insets(2, 2, 2, 2);↵
|
11 | c.gridx = GridBagConstraints.REMAINDER;↵ | | 16 | c.gridx = GridBagConstraints.REMAINDER;↵
|
12 | c.anchor = GridBagConstraints.NORTHEAST;↵ | | 17 | c.anchor = GridBagConstraints.NORTHEAST;↵
|
13 | gridbag.setConstraints(buttonPanel, c);↵ | | 18 | gridbag.setConstraints(buttonPanel, c);↵
|
14 | panel.add(buttonPanel); | | 19 | panel.add(buttonPanel);
|