}
}
public static void main(String[] args) {
final DraggableStack stack = new DraggableStack();
stack.push(new DraggableLabel("A"));
stack.push(new DraggableLabel("B"));
stack.push(new DraggableLabel("C"));
JButton add = new JButton("+");
add.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent event) {
stack.push(new DraggableLabel("X"));
}
}
);
JButton remove = new JButton("-");
remove.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent event) {
stack.pop();
}
}
);
JScrollPane scroll = new JScrollPane(stack);