Game programming with Java
HomeAufgabennPrintJava-Online

JGameGrid in NetBeans

Developing more complex applications using several classes it is easier to work with a local development environment. We recommend NetBeans instead of our Online-Editor.

1. Installing NetBeans

You need the following components:

  • JDK (Java SE Development Kit can be downloaded for free from oracle.com)


 
  • NetBeans (for free from the webpage netbeans.apache.org). We recommend the english Version "Java" including Java EE and Java ME (214 MB) or the complete version.


  • The class library JGameGrid.jar can be downloaded from our website: download JGameGrid.jar.
    SaveJGameGrid.jar for example, in the folder C:\jars
  • You also need the class library
    Download aplu5.jar
    Save aplu5.jar, for example, in the folder C:\jars.
   

2. Create a JGameGrid project

Start NetBeans and choose New Project  from File.


Select the category Java from Projects Java Application and click Next

 

Typ in a project name and define the project location.

 

 

 

 

Deselect Create Main Class and Set as Main Project.

Click Finish.

 

3. Including the class library JGameGrid


 

Right-click on Libraries and select Add Jar/Folder.

Add JGameGrid.jar .

 

 

4. Creating a new class

Right-click on <default Package> . Select New - Java Class

Typ in a class name and click on Finish.
A project can contain several classes.

 

 

5. Adding Sprites

Create a directory sprites in your NetBeans project directory src.

All pictures used as characters or background need to be placed inside this directory.

 

6. Compiling and executing the program


Right-click the class and select Run File.  

 

7. Saving the game as a self-executing jar-file


 

Right-click on the project name and select Clean and Build. Choosing this option the compiled class and the directroy sprites are added to the jar-file. This file can be found in the NetBeans project directory dist.


 

Instructions as PDF: GameGridNetbeans.pdf