

Add a JPanel that fills the JFrame entirely. Set the layout of the contentPane to GroupLayout. Make the dimensions of the JFrame about 600×400. Create the user interfaceĪdd a JFrame form to the package view (right-click the package view folder, select New > Other …). The model package contains the game elements classes, the view package contains the userinterface classes. The code of this project is organised in packages. If you open all the folders, the project should look like this: You will get a few errors, these will be fixed shortly (read on). Do you want to overwrite?” answer “Overwrite”.

If you get a Question “Assignment5_s1234567\src exists. In the Windows Explorer (or Finder), Copy all folders from the folder to which you extracted the zip-file and Paste that into the project (right-click the main project folder, choose Paste).


The balls come from a launcher which launches balls with random trajectories and speeds. The basket is located at the bottom of the screen and can only move to the left and right. The aim is to catch as many balls as possible and earn points that way. The user of the game controls a basket in which the balls must be collected. In this tutorial, you will make a simple game in which balls are launched, which we then have to catch.
