package engine;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Main extends JFrame {

    public Main() {
        setTitle("TITLE");

        MyJPanel panel = new MyJPanel();
        panel.setPreferredSize(new Dimension(800, 600));
        panel.shapeList.add(new RectangleShape(100, 100, 100, 100, new Vector2D(), 0, 0, Color.BLUE));
        panel.shapeList.add(new CircleShape(10, 10, 100, new Vector2D(), 0, 0, Color.YELLOW));
        setContentPane(panel);

        pack();
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setResizable(true);
        setVisible(true);
    }

    class MyJPanel extends JPanel {

        ArrayList<Shape> shapeList = new ArrayList<>();

        @Override
        public void update(Graphics g) {
            paintComponent(g);
        }

        @Override
        protected void paintComponent(Graphics g) {
            g.setColor(Color.black);
            for (Shape shape : shapeList) {
                shape.paint(g);
            }
        }

    }

    public static void main(String[] args) {
        Main main = new Main();
    }
}

@@ -102,22 +102,151 @@
 ava.
-util.ArrayList
+awt.event.ActionEvent;%0Aimport java.awt.event.KeyEvent;%0Aimport java.util.ArrayList;%0Aimport javax.swing.AbstractAction;%0Aimport javax.swing.Action
 ;%0Aim
@@ -296,16 +296,46 @@
 .JPanel;
+%0Aimport javax.swing.KeyStroke;
 %0A%0Apublic
@@ -1000,24 +1000,561 @@
 yList%3C%3E();%0A%0A
+        public MyJPanel()%7B%0A            addKeyBindings();%0A        %7D%0A        %0A        private void addKeyBindings() %7B%0A            char exit = KeyEvent.VK_ESCAPE;%0A            getInputMap().put(KeyStroke.getKeyStroke(exit), %22exit%22);%0A            getActionMap().put(%22exit%22, exit());%0A        %7D%0A%0A        private Action exit() %7B%0A            return new AbstractAction() %7B%0A                @Override%0A                public void actionPerformed(ActionEvent e) %7B%0A                    System.exit(0);%0A                %7D%0A            %7D;%0A        %7D%0A        %0A
         @Ove
@@ -1633,33 +1633,41 @@
 t(g);%0A        %7D%0A
+        
 %0A
-
         @Overrid
@@ -1753,13 +1753,13 @@
 lor.
-black
+BLACK
 );%0A 
@@ -1914,27 +1914,15 @@
 ) %7B%0A
+
        
- Main main =
  new

Revert "Revert "added keybindings""