| |
Getting Started
To construct and run an application file in the J++ 6.0 environment, perform the
following steps:
- Invoke the J++ 6.0 environment.
- You should now be looking at the "New Project Dialog" box. Set the name
for the project to be "Hello".
- On the left hand side of the "New Project Dialog" box, select
"Applications".
- On the right hand side of the "New Project Dialog" box, select "Console
Application".
- Click the "Open" button at the bottom of the "New Project Dialog"
box.
- On the right hand side of the screen, expand "Hello" and double click on
"Class1.java".
- You should now see the default code for an application.
- Add the "System.out.println("Hi");" statement to the body of the
"main" program.
- Compile and run the program by selecting the "Start" button (the blue triangle
pointing to the right). If you wish to look at the program's output longer, pull up
an MS-DOS prompt, go the appropriate directory, and run the program from the MS-DOS prompt
by typing in "Hello".
Helpful Hints
 | To construct a new application, select "console application" from the
"applications" options. |
 | To construct a new applet, select "Applet on HTML" from the "web
pages" options. |
 | To import existing code, select "empty project" from the "Visual J++
Projects" options and point the empty project to the directory where you have stored
the code. |
 | It is possible to chain up the inheritance hierarchy of any object by examining its
superclasses in the class outline. |
 | You can overload inherited methods by right clicking on them in the "inherited
members" portion of the class outline and selecting "Override Method" in
the context menu. |
Shortcuts
 | ctrl-]: go to matching brace or parenthesis or bracket. |
 | F1: invoke online help about statement where cursor is positioned. |
 | alt-F8: format the highlighted block of code nicely |
 | ctl-f: pop up the find dialog box with current word cursor is positioned on |
 | look up "keyboard shortcuts" under the index for online help for a complete
list of available shortcuts |
Known Bugs/Fixes
Problem: If you make a project with the "Console Application" wizard and then
rename class1 to some other name (along with the class1.java file), the compiler will spit
out the error "Specified main class not found: class1" (or something to that
effect).
Solution: Go into the project properties. On the compiler tab there will be a
listbox which should contain the name of the class which contains your 'main' function.
Click on that box and select the classname again. (Even though it was already
displayed in the box). Your program will now compile as expected. You only
have to do this once. (Not every time you load the project.)
|