- You need to have newest version of JDK installed on your system. Note that only the version labeled JDK will work. Not the one labeled JRE, nor the one that comes with NetBeans, nor the EE version. Go http://www.bluej.org and download Blue J with the JDK
-
The Scanner Class
The Scanner class will be used for input, it also works on Jeliot. To get it to work with your Bluej program you just have to import the class before your program
import java.util.Scanner;
and then create an instance of your class inside your program (you can call it whatever you want to, but lets call the variable in so we are all doing the same thing.
Scanner in = new Scanner(System.in);
You can then enter Strings, integers and doubles from the keyboard with the following commands:
String n = in.nextLine();
int n2 = in.nextInt();
double n3 = in.nextDouble();
-
To get Gridworld code working with BlueJ (later in year)
If you don't have GridWorld Click Here
To get BlueJ to work with GridWorld - Tools - Preferences - Libraries - Add - find the folder with gridworld.jar - Open - OK
|
|