hello world in the forte ide an introduction to the forte ide (integrated development environment)...
TRANSCRIPT
![Page 1: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/1.jpg)
Hello World in the Forte IDE
An introduction to the Forte IDE (integrated development environment)
writing the classic “Hello World” program in Java
![Page 2: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/2.jpg)
Create a folder for your projects
• One way is to use Windows Explorer (WE)
• On the left-hand-side of WE, click on the location where the folder is to be created
• On the right-hand-side of WE, right click in the open area and choose from the menu New and then Folder
![Page 3: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/3.jpg)
Create a New Folder
![Page 4: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/4.jpg)
Rename the FolderRight click on the Folder and choose Rename, then type the name, press ENTER
![Page 5: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/5.jpg)
Start Forte:Start/Programs/Forte for Java CE/ Forte for Java CE
![Page 6: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/6.jpg)
Start Forte (Alternative):Double click on the runidew icon found in forte4j/bin
![Page 7: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/7.jpg)
Close Tip Window(if it appears)
![Page 8: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/8.jpg)
Forte at Startup
Explorer window
Properties window
Main window: menus and toolbars
Desktop showing through
Filesystems, see next slide
![Page 9: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/9.jpg)
Right click on Filesystems (circled on previous slide) in the Explorer Window
Choose Mount Directory from the menu
![Page 10: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/10.jpg)
The Mount Directory Dialog Box
![Page 11: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/11.jpg)
Use the Mount Directory “Look in” drop-down box to choose a drive and the region below to select a folder
![Page 12: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/12.jpg)
Alternative: Choose File then Mount Filesystem on the Main Window menu to bring up the dialog box shown below
Type the folder’s path or “Browse” for it , then click OK
![Page 13: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/13.jpg)
To remove any previous Filesystem, right click on it and choose Unmount Filesystem
![Page 14: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/14.jpg)
Java Packages
• In order to facilitate “portability” (moving a program from computer to computer), Java breaks references to a file’s (complete/full) path (its location) into two parts – An external part (known as the CLASSPATH) which
will change as the program is moved around (mounted)
– An internal part which will not change as the program is moved around (package.class)
• The dividing line is a folder known as “a package”
![Page 15: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/15.jpg)
To create a package for your project, right click on the particular filesystem and choose New Package
![Page 16: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/16.jpg)
Name the packageNOTE: Java’s convention is that only class names are capitalized, Java is case sensitive: hello Hello
small letter
![Page 17: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/17.jpg)
Make your package part of current project (click Yes)
![Page 18: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/18.jpg)
Right click on package folder, select New/Classes/Main
This template (Main) has a method (main) needed to start execution
![Page 19: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/19.jpg)
Name your class;Java convention is that class name are capitalized
Capital letter
![Page 20: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/20.jpg)
Finish
• For the simple Hello World project in this example, one might as well click Finish at this stage
• However, we will step through a series of dialog boxes that may prove useful when writing future projects
![Page 21: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/21.jpg)
Dialog Box #1
Click Next
![Page 22: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/22.jpg)
Dialog Box #2
![Page 23: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/23.jpg)
Dialog box #3
Most classes have fields (or properties) and we could begin to list them here
![Page 24: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/24.jpg)
Dialog box #4
Classes also have methods which could be added here
![Page 25: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/25.jpg)
Make class part of current project
![Page 26: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/26.jpg)
The Source Editor Window appears.This is where we will type the code.Some code is already provided.
![Page 27: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/27.jpg)
Source editor
comments
package
Beginning of class
![Page 28: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/28.jpg)
Some features
• Comment: anything between /* and */ is a comment — they are ignored by the computer and are there for the sake of the programmer or anyone else reading the code
• The Hello class begins with the line
public class Hello extends Object– public, class and extends are keywords or reserved
words, which is why they are in a different color
![Page 29: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/29.jpg)
Hello World
• For this simple program, we will add just one line to what was supplied by the IDE
• That line is System.out.println(“Hello World.”);
• It belongs inside the curly brackets associated with the main method
• Curly brackets {} set off a unit of coding known as a block
![Page 30: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/30.jpg)
The main method
the main method
Constructor, not needed for this program
![Page 31: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/31.jpg)
Indenting scheme convention
• Free-formatting: white space (spaces, tabs, returns) are usually ignored by the computer when interpreting Java
• To make the program more readable (not to the computer but to the human beings), certain conventions are followed
• One convention is to place the curly brackets on a line by themselves and have them vertically aligned (indented the same amount) and then anything within the curly brackets is indented further
![Page 32: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/32.jpg)
Start typing the lineAfter typing the period, notice the pop-up menus
![Page 33: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/33.jpg)
Java is case-sensitive
• Java is case-sensitive• In the one line, System (a class) must be
capitalized, out (an object) must not be capitalized• The pop-up menus provide the properties and
methods associated with a class or object • If they do not pop up, it is a good indication that
there is a typo
![Page 34: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/34.jpg)
Hello World Program
![Page 35: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/35.jpg)
Right click on Hello (the class not the package) and choose Compile
![Page 36: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/36.jpg)
The Output Window appears if there are errors; In this case there is a missing semicolon
Error reported on line 28 although line with missing semicolon is line 27 (free –formatting)
![Page 37: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/37.jpg)
Edit (add semicolon), Compile again, then Execute: Right click on class and choose Execute
![Page 38: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/38.jpg)
Output Window
![Page 39: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/39.jpg)
Execution Shortcut
![Page 40: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/40.jpg)
Build and Compile Shortcuts
![Page 41: Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java](https://reader033.vdocuments.mx/reader033/viewer/2022042616/56649f055503460f94c1ae1d/html5/thumbnails/41.jpg)
Windows Explorer