![bluej example projects download bluej example projects download](https://i.ytimg.com/vi/l5VnCRwt1d0/maxresdefault.jpg)
If i try to right click any of the other ones: Database, Person or Student and select "Compile" i get "Compiling.Done" but the diagonal stripes do not disappear. "Recompile with -Xliint:unchecked for details"įollowed the steps on this post to disable the pop-up: Īt this point the diagonal stripes have ONLY disappeared for Staff. This time, you were prompted to fill-in the parameters of the Object, so it could set up its initial values. Note there are two String values, which need to be enclosed in quotes. You can copy the values shown below, and then click OK. You will now be given a prompt for both an Object name and parameters.This time, click on new Student(String, int, String).To see this, let's create one more Object, this time a Student: Notice how an object now shows up on the object bench.Īll you needed when creating that object was its name, but sometimes Objects ask for more information so they can start off with certain data. You'll get a box asking you to name your new object, but you can leave the default suggestion and click OK.Click on the second menu item, new Staff().To create an actual object, right-click on a Class and click on a "new" menu item. Creating ObjectsĪs mentioned before, Classes are like blueprints to define specific instances (or Objects) of code.
![bluej example projects download bluej example projects download](https://mac-cdn.softpedia.com/screenshots/BlueJ_2.jpg)
The main pane shows a diagram of each Class in a project and their relationships with each other. You should then see the following screen (without the blue markup):īlueJ lets you create and view Classes and Objects in a visual manner. (You can also open a project from within BlueJ by clicking on Project > Open Project. Open the people folder and click on the BlueJ package.If you cannot find it, download a copy of examples and unzip it. On Windows, look in C:\Program Files (x86)\BlueJ or C:\Program Files\BlueJ. Find the folder where BlueJ is installed and open the examples folder inside.You can skip the "real code" parts for now, and come back to them to reference later. We will see different actions that you can do with BlueJ and also how its done with real code. More About BlueJīlueJ lets you interact with Objects in your code directly which helps when learning concepts or to try something out quickly. You can view a longer BlueJ tutorial on the BlueJ site. You will be using the “println” method often, so you will want to make sure you can do it quickly and without needing to look up how to type it in correctly.This node will cover the basics of using BlueJ and connect it to using Java. By working backwards, you can start to recognize the types of things that cause common errors. The error messages are hard to understand at first, but you need to start learning to use them to find errors in your code. Spell “System” wrong or forget to capitalize it.Move your print command to the wrong part of the program.Run the code each time and read the compiler’s error messages. “Break” your code in a few different ways to see what sort of error message you get.For example, make it say “This is my first program.” and then a new line to print “Learning to program takes a lot of work, but it is worth it!” (each of these command ends with a semicolon ) Add more code so your program will print multiple statements when you run it.Lines of code between curly braces make up a code block. You can delete everything between the first and last curly bracket, then type the part that says “public static void main(). You can clean this up by deleting text so it just looks like this: public class FirstProgram (download and install BlueJ if running on your own computer)įrom the Project menu, click New Project.Ĭhoose a folder to save this project and give it a reasonable name.Ĭlick the icon that appears, and you will see some pre-written code.