@@ -0,0 +1,3087 @@
+package test;%0A%0Aimport javax.swing.*; %0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0Aimport java.awt.event.KeyEvent;%0Aimport java.util.ArrayList;%0Aimport java.awt.*;%0A %0Apublic class ModifyTo extends JPanel implements ActionListener%0A%7B%0A    protected JButton button;%0A    protected JButton button2;%0A    protected static String input;%0A    protected static boolean isDone;%0A    protected JTextField text;%0A    protected JLabel label;%0A    ArrayList%3CJButton%3E buttons;%0A    ArrayList%3CJLabel%3E labels;%0A %0A    public ModifyTo(String%5B%5D toCages, String%5B%5D toRanges, int%5B%5D capacities)%0A    %7B%0A        buttons = new ArrayList%3CJButton%3E();%0A        labels = new ArrayList%3CJLabel%3E();%0A        %0A        Box box = Box.createVerticalBox();%0A        %0A        Panel panel;%0A        Panel bottomPanel = new Panel(new FlowLayout());%0A        %0A        for (int i = 0; i %3C toCages.length; i++)%0A        %7B%0A            if (toCages%5Bi%5D != null)%0A            %7B%0A                panel = new Panel(new FlowLayout());%0A                %0A                label = new JLabel(%22Cage %22 + toCages%5Bi%5D + %22: %22 + toRanges%5Bi%5D + %22, Capacity: %22 + capacities%5Bi%5D);%0A                panel.add(label);%0A                labels.add(label);%0A                %0A                button = new JButton(%22Remove%22);%0A                button.setMnemonic(KeyEvent.VK_D);%0A                button.addActionListener(this);%0A                button.setActionCommand(%22%22 + i);%0A                panel.add(button);%0A                buttons.add(button);%0A                %0A                box.add(panel);%0A            %7D%0A        %7D%0A        %0A        button2 = new JButton(%22Cancel%22);%0A        button2.setMnemonic(KeyEvent.VK_D);%0A        button2.addActionListener(this);%0A        button2.setActionCommand(%22cancel%22);%0A        %0A        bottomPanel.add(button2);%0A        %0A        setLayout(new BorderLayout());%0A        add(box, BorderLayout.NORTH);%0A        add(bottomPanel, BorderLayout.SOUTH);%0A        %0A        %0A        isDone = false;%0A    %7D%0A    %0A    public void actionPerformed(ActionEvent e)%0A    %7B%0A        if (%22cancel%22.equals(e.getActionCommand()))%0A        %7B%0A            input = %22-1%22;%0A        %7D%0A        else%0A        %7B%0A            input = e.getActionCommand();%0A        %7D%0A        isDone = true;%0A    %7D%0A %0A    public static String createAndShowGUI(String%5B%5D toCages, String%5B%5D toRanges, int%5B%5D capacities)%0A    %7B%0A        JFrame frame = new JFrame(%22Cage Panel%22);%0A        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A %0A        ModifyTo newContentPane = new ModifyTo(toCages, toRanges, capacities);%0A        newContentPane.setOpaque(true);%0A        frame.setContentPane(newContentPane);%0A %0A        %0A        frame.setVisible(true);%0A        frame.pack();%0A        frame.setLocationRelativeTo(null); %0A%0A        while (isDone == false)%0A        %7B%0A            try%0A            %7B%0A                Thread.sleep(100);%0A            %7D%0A            catch (InterruptedException e)%0A            %7B%0A                %0A            %7D%0A        %7D%0A        frame.setVisible(false);%0A        frame.dispose();       %0A        %0A        return input;      %0A    %7D%0A %0A    public static void main(String%5B%5D args)%0A    %7B%0A%0A    %7D%0A%7D%0A

Create ModifyTo.java