Using the jGrasp Environment

What is an IDE (Integrated Development Environment)? Which two IDEs would I suggest? What is jGrasp and how do you download and install it? You can find out in my previous article by clicking here.


This is where I left off with jGrasp in my article Getting Started with Coding in Java:



jGrasp Starting Screen


The jGrasp Tool Bar



jGrasp toolbar
The toolbar has many useful buttons that make coding easier

 

The buttons we are going to use (Shortcuts are for mac):

 

Image of the open file button– Open File

 

Save file button– Save File –  ⌘-s

 

Cut Button– Cut – ⌘-x

 

Copy Button– Copy – ⌘-c

 

Paste Button– Paste – ⌘-v

 

Undo Button– Undo – ⌘-z

 

UML Button– Generate UML Class Diagram

 

Compile Button– Compile – ⌘-b

 

Run Button– Run – ⌘-r

 

Debug Button– Debug – ⌘-d

 

Running Your Code in jGrasp

 

When you have written your code you have to first save and compile it. You can do this either by using the above mention shortcuts or by pressing the accompanying buttons. After saving and compiling you should receive a message like this:

 

Compile Screen

 

Once you have this message that tells you that there are no coding errors (This does not mean there are no logic errors. Code can still run even if it does not work the way it is supposed to), you are in the clear to run your code. Do this by using the shortcut or by pressing the button.

 

Debugging Your Code

 

Debugging is used to de-bug your code (A bug is an error in the code). We can debug the code by placing break points. You can place break points by putting your mouse on the side line and clicking. It should look like this when a break has been placed:

 

 Break point screen

 

You can now step from line to line and run the code slowly. The debugging tool will allow you to see specifically where the error lies in your code.

 

Generating a UML Class Diagram

 

Generating a UML (Unified Modelling Language) diagram allows you to view your code as a diagram similar to a mind map where it shows the connections and what each method or class contains. This is not necessary, it is just a useful way of showing a break down of the code. You can do this by simply clicking the aforementioned button.
YouTube
LinkedIn
Share
RSS