

Java Programming with BlueJViewing the Source Code The source code for the methods is shown here in the class definition. Right-click the class, click Open Editor. The source code for a class can be viewed by opening the editor.Java Programming with BlueJViewing the Source Code Note that the method signature indicates the type of data to be entered.When a method requires a parameter you will get a second window to enter that parameter.Java Programming with BlueJMethod Signatures For example the moveVertical method requires a distance and changeColor requires a color Parameters to methods Java Programming with BlueJParameters Some methods require a parameter be passed to it. makeVisible( ) from the menu creates the blue ball in another window You should see a blue ball appear in a separate window.Click the method to invoke from the menu, try makeVisible( ).Right-click the object on the object bench.

Java Programming with BlueJInvoking Methods Note the naming conventions of lowercase for objects and uppercase for classes Class Object on the Object Bench.To create an instance of the Circle class in the shapes project.Java Programming with BlueJCreating Instances of Classes Opening setup You may need to COMPILE the given files If each class has /’s under them RIGHT click on each class Select Compile

The shapes project initially looks like this: The shapes project Java Programming with BlueJ We will examine the features of BlueJ by working with the shapes project. Opening a preexisting BlueJ Project Will need to do this: For THIS presentation And whenever you SAVE and return to a project Directions Open BlueJ Project -> Open Project -> C:\BlueJ\examples\shapes Java Programming with BlueJObjectives View the source code Give examples of different data types Identify the 4 parts of a method signature Identify comments Identify accessor and mutator methods Use the printing methods Use selection statements Identify local variables Java Programming with BlueJObjectives By the end of this presentation you should be able to: Open a BlueJ project Create an instance of a class Invoke methods of a class Toggle between the project window and the output window Identify parameters to a method You can do the same thing using an executable JAR, so the window will stay open you open a console window and type "javaw -jar Shelf.jar" provided your executable JAR file is called Shelf.jar or just double click on the JAR file from file browser and it's going, but like I said it will close the window as soon as your program is done.Java Programming with BlueJ (Gift from Krysten Hall) Editted by Mr. Also you will need to be in the folder where your Shelf.class file is located. You can run the class file by itself "javaw Shelf" or possibly "javaw Shelf.class" this has to be done at a console window and javaw.exe has to be in the path statement of the local machine. This is probably an option in BluJ, but be advised if you make an executable JAR and he has the JRE installed locally, he will run the file alright, but when the program is done, it will exit and close the console window immediately, so he will not be able to sit and look at the result of your program.

Your program looks fine at a glance, as you have never said it does not run I will assume that it does. I have never used BluJ, but use NetBeans all the time-at this point many of the IDE's have executable JAR options.
