.dmg
). Once you find it in your Downloads folder and double-click it, you should see a window like the one below. Click on the BlueJ icon and drag it to the folder. You're done!
.java
), a file called package.bluej
that stores information about the project, and some other odds and ends. To make it easier to download, I've zipped up the UPS_figures project folder into a .zip
archive. After downloading it, extract its contents, open the folder, and double-click on the package.bluej
file to open the project in BlueJ. (Raise a hand if you need some help extracting the files from the .zip
archive.) You should end up seeing a window like this:
package.bluej
, it's because you didn't really extract the project from the .zip
archive. (Windows, in particular, can fool you into thinking it's extracted when it's really not since it lets you "browse" the files in the archive while they're still compressed.) Quit BlueJ, double-check that you extracted the files from the archive, and try again if this happens to you.
If you get an error message saying "BlueJ could not find any Java systems. A JDK must be installed to run BlueJ", it means BlueJ can't find the Java software it needs. Either you didn't use the installer that had the JDK included, or something went wrong. There's an entry in the BlueJ FAQ that can help you sort things out.
Circle
class, and select "new Circle()" from the drop-down menu that appears. (See below.) Click "Ok" on the window that pops up proposing the name "circle1" for your new Circle instance, and you should then see a new red rectangle appear representing the new Circle object you created.
makeVisible
.) Note that some of the behaviors require additional information before they can do their work. For example, changeSize
wants to know what the new size should be, so it will prompt you to enter a number before it runs.
Once you've created the house, extend it with your own objects. Make a larger house with a window and a door, for example, or add a sun in an appropriate position. If you're up for an additional challenge, see if you can come up with a shorter sequence of steps to draw my house.
- Make a new Square, called "house"
- Make house visible
- Make house
"blue"
- Move house left
- Move house left
- Move house left
- Move house left
- Move house left
- Make a new Triangle called "roof"
- Make roof visible
- Move roof up
- Move roof up
- Move roof up
- Move roof up
- Move roof right
- Move roof horizontally by 10
changeSize
) and which don't (e.g. makeVisible
)? Feel free to change some of the Java code and see what happens. For example, what if you rename moveRight
to be called goRight
? (Recompile the code before creating instances of your modified class.)