The code does not exhibit the behavior you describe.
However, you have two separate instances of Drawing:
frame.addKeyListener(new Drawing());
//....
Drawing instance=new Drawing();
Remove the top one and use the one in main:
Drawing instance=new Drawing();
frame.add(instance);
frame.addKeyListener(instance);
Also, do not call repaint() in paintComponent(Graphics) as this will continuously generate paint calls. Call it after you make some modification to state - e.g. in keyPressed(KeyEvent).
See also Painting in AWT and Swing.