package game;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;

public class Screen extends JPanel {
  private static final int WIDTH = 800;
  private static final int HEIGHT = 600;

  public Screen() {
    setPreferredSize(new Dimension(WIDTH, HEIGHT));
    setBackground(Color.GRAY);
  }

  private void draw(Graphics g) {
    Graphics2D g2d = (Graphics2D) g.create();
  }

  public void tick(boolean[] keys) {

  }

  public void render() {
    repaint();
  }

  @Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    draw(g);
  }
}

@@ -111,16 +111,48 @@
 phics2D;
+%0Aimport java.awt.RenderingHints;
 %0A%0Aimport
@@ -292,16 +292,200 @@
 = 600;%0A%0A
+  private double size = 50.0;%0A  private double inc = 1.0;%0A%0A  private double x = WIDTH / 2;%0A  private double y = HEIGHT / 2;%0A%0A  private double xVel = 2.0;%0A  private double yVel = 2.0;%0A%0A
   public
@@ -670,48 +670,651 @@
 ;%0A  
-%7D%0A%0A  public void tick(boolean%5B%5D keys) %7B%0A
+  g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);%0A    g2d.fillOval((int) (x - size / 2), (int) (y - size / 2), (int) size, (int) size);%0A  %7D%0A%0A  public void tick(boolean%5B%5D keys) %7B%0A    if (size %3E= HEIGHT %7C%7C size %3C= 10) inc = -inc;%0A    if (x + size / 2 %3E= WIDTH) %7B%0A      x = WIDTH - size / 2;%0A      xVel = -xVel;%0A    %7D%0A    if (x - size / 2 %3C= 0) %7B%0A      x = size / 2;%0A      xVel = -xVel;%0A    %7D%0A%0A    if (y + size / 2 %3E= HEIGHT) %7B%0A      y = HEIGHT - size / 2;%0A      yVel = -yVel;%0A    %7D%0A    if (y - size / 2 %3C= 0) %7B%0A      y = size / 2;%0A      yVel = -yVel;%0A    %7D%0A    x += xVel;%0A    y += yVel;%0A    size += inc;
 %0A  %7D

Add ball bouncing demonstration