120 likes | 340 Views
Compiling and running Java programs with BlueJ. Successfully compiled files program files in BlueJ. You can tell from the shade of a program icon in BlueJ whether the program has been successfully compiled (translated). Successfully compiled files program files in BlueJ (cont.).
E N D
Successfully compiled files program files in BlueJ • You can tell from the shade of a program icon in BlueJ whether the program has been successfully compiled (translated)
Successfully compiled files program files in BlueJ (cont.) • Icon shades: • Shaded: this program has notbeen compiled successfully
Successfully compiled files program files in BlueJ (cont.) • Unshaded: this program has been compiled successfully
Compiling (translating) your Java program with BlueJ • You can compile (= translate) a Java program in BlueJ in 2 different ways:
Compiling (translating) your Java program with BlueJ (cont.) • From BlueJ'seditor window: • Left click on the Compile button
Compiling (translating) your Java program with BlueJ (cont.) • 2. From BlueJ'smain window: • Right click on the program file and then left click of the Compile menu button
Compiling (translating) your Java program with BlueJ (cont.) • When the program is compiled successfully, the icon in the main window (associated with the program) become unshaded:
Running a (successfully compiled) Java program with BlueJ • Execute a Java program in BlueJ: • Right click on the program file in BlueJ's main window, and then • Left click on the void main(String[]args) tab:
Running a (successfully compiled) Java program with BlueJ (cont.) • 3. A window will pop up: • Left click on OK to run the program.
Running a (successfully compiled) Java program with BlueJ (cont.) Result: the output of the program is shown in BlueJ's "terminal" window: