How does jgrasp work




















One way is to click on Build and pull down to Run Arguments. This will open an entry field below the tool bar that you can use to enter the arguments delimited by spaces that will be passed to main when you run the application. When the box next to it is selected, no arguments are passed to main , when it isn't whatever arguments are in the field are passed to main. Some editors use tabs and some use spaces. This makes it a little difficult to move between editors. Most, however, allow you to switch between the two.

Strangely, when giving the project a name, you must put the project name in the "File N ame:" box. The name you give your project will also be the name of your Java program file.

Note: It is easiest and always correct if you give the folder, the project, and the file the exact same name. If you use the A: drive as shown here, you will not lose the project when you log off. Your window should look as follows. Double click on the new HelloJgrasp folder to open the folder, then click on the Create button to create your new project.

Now that you have a new project you can create your first file. You may maximize the text input window bu clicking on the arrow icon on the top right of the window. You may also resize any of the other windows by clicking and dragging the borders or clicking the arrows on their borders.

Step 4. Step 5. To use the menu bar in the edit window, the edit window must be active. If you have just finished typing in your program, the edit window and, thus, the edit menu bar should be active.

If it is not, simply click the mouse anywhere in the edit window. Before you can compile and run your new program, you must save the file you have just created. Save your new file in the same directory as your project. Now you must add this file to your project. Double click on the java file to add it to your project. If you have previously or now chosen the Project tab on the left window, you will see that the project now contains the java file.

Often the Add Files dialog box will not disappear after you have added the file. When you see the file added to the project you know you can close the Add Files dialog box. The dialog box may be remaining open in the event you have more files to add. The file should automatically be saved with the same name as the project.

If the correct file name is not automatically put in, be sure to type in exactly the same name as your project, in this case HelloJgrasp. Again, this must also be the name of the project and should be the name of the folder. Step 6. If your program does not Compile successfully, you probably have syntax errors. A description of the error will be shown in the Compile Messages box in place of the operation complete message. CLICK on the blue arrow next to the line in the Compile Message box that shows the directory, line number, and error message.

The error should now be highlighted in the text editing window. Scroll to the text editing window if the line of code is not showing to find and fix the problem. Repeat this process until you have fixed all errors that appear in the Compile Messages box. Note: The compile error message will show you where the compiler thinks the error is.

It may be before the given line. Your program is now ready to execute! Click on the run-application-for-current-file button, identified by a red person running. A new window will appear with the message " Hit any key to start ". Press the space bar for example and the output produced by the program will appear. We expect the message "Greetings, Earthling. If you fail to do this, then the program you're running does not reflect the changes you made to the source files since the last time you compiled it.

It is very, very easy to spend half an hour trying to fix a problem with a program only to discover that you've been forgetting to click the compile-and-link button. To illustrate this lesson, delete the word "main" in the editor window, and click run button. While you can save your code with a different filename, you won't actually be able to compile and run your code later. Assuming your code contains a class definition e. Once you have selected a place to save the file along with the filename, hit the Save button.

An illustrative image is shown below. Once your code is written, you can try to compile it.



0コメント

  • 1000 / 1000