Questions tagged [drjava]

A lightweight IDE for java, designed primarily for students

DrJava is a lightweight development environment for writing Java programs.

It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users. DrJava is available for free under the BSD License, and it is under active development by the JavaPLT group at Rice University.

For more information and downloads, visit the official site.

188 questions
23
votes
3 answers

I can't figure out why DrJava won't output Unicode symbols

I'd like to apologize upfront for my incredible newb-ness with regard to Java and programming in general. But I've searched everywhere for an answer to this and I just can't seem to find one. So I'm simply trying to run the following: public class…
Chris Middleton
  • 5,654
  • 5
  • 31
  • 68
15
votes
2 answers

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException Error

Hello I'm a new programmer at an high school level as a result I do not know much about programming and am getting quite a few errors which have been resolved while others I completely do not understand. I am to make a simple Check Box selection…
9
votes
1 answer

How to check if an integer is a perfect square

How could I write an if-then statement that checks if an inputted integer is a perfect square or not (i.e. if I took the square root, it would be an integer as well: 4, 9, 16, 25, 36, etc.) in DrJava? Thank you!
Brooke
  • 103
  • 1
  • 1
  • 3
7
votes
2 answers

Close what is already already running when running in eclipse

i was wondering if in eclipse there is a way for eclipse, when you press the play button(run), it closes the already running program. For example, if anyone has every used Dr. Java, when you click run it basically closes all the running, compiled,…
Exikle
  • 1,155
  • 2
  • 18
  • 42
5
votes
3 answers

DrJava: Cannot run code using JDK8.0

Anyone having trouble using jdk 8.0 ?? Well, I don't know why I am facing some disturbances. Not sure why , after compiling a javacode in 'drjava' while I try to run it , it says ... " Current document is out of sync with the Interactions Pane and…
Siratim
  • 61
  • 1
  • 1
  • 7
4
votes
3 answers

Scanner for string does not work in Java

When I use scan.nextLine(), input boxes don't work properly. If it's scan.next() ,works perfectly.But Why? Ain't I supposed to use scan.nextLine() for string? import java.util.Scanner; public class Test{ public static void main(String[] args){ …
2apreety18
  • 181
  • 3
  • 8
3
votes
1 answer

Addition method causing IDE crash, no error code

For my assignment I am to create 5 Classes in a hierarchy that extends Number. I am to create methods of addition subtraction multiplication and devision for each of the classes that has two parameters and a return type of the class. The method…
Ocasta Eshu
  • 841
  • 3
  • 11
  • 23
3
votes
1 answer

NullPointerException with JFrame

At the moment all I want this program to do is run without any compile errors. Basically, what I need it to do is open the frame and then when the frame is selected, if I press the up arrow key it will set arrows[0] to true and when I release it it…
Aerophite
  • 195
  • 2
  • 14
3
votes
3 answers

why does my program print the numbers in my array as zeros but still print the largest value out of the array?

import java.util.*; import java.util.Arrays; import java.util.Random; class EZD_maxTester { static int variables[] = new int[10]; static int maximum() { Random rand = new Random(); int max = variables[0]; for (int i = 0; i <…
bugjuice
  • 31
  • 7
3
votes
2 answers

Error in piping java programs

I have a class RandomSeq which prints "args[0]" random doubles and a class Average which prints the average of StdIn. I'm using DrJava for writing codes and compiling.I've downloaded the StdIn and out libraries and put them in the same folder of my…
Zeta.Investigator
  • 911
  • 2
  • 14
  • 31
3
votes
1 answer

Cannot Find getWindow(Applet) in netscape.javascript.JSObject

I am trying to call JavaScript functions from a JApplet. I've searched through tutorials and they say that I need to import and use netscape.javascript.* from my \jre\lib\plugin.jar I did import netscape.javascript.* and I'm using DrJava, and it…
darolandi
  • 71
  • 10
3
votes
3 answers

Why is drJava throwing me an error here on my String?

I know this may be a really dumb question, but I'm testing out the Interactions pane in drJav. I create a String variable, then try to do .length on it: String fish; String[] hooo; hooo.length then I get an error, whic is puzzling me…
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
2
votes
0 answers

Issues debugging on Dr.java with a windows computer

I downloaded the latest version of dr.java - and also downloaded jdk-14.01_windows-x64_bin.exe and jdk-14.01_windows-x64_bin.zip I also tried using openjdk-8 and tried running dr.java. Dr java is able to run and compile fine, but whenever I try to…
2
votes
0 answers

Swapping letters in a string

Basically, I'm trying to integrate the code structure our course textbook tells us to use, which is setting a first, middle, and last part of the string, then printing it using concatenation (structure shown in the code), but get a…
2
votes
1 answer

Odd behaviour when importing classes

I am currently using DrJava and when I write the following import statement: import java.util.Arrays; I get the following error message: Error: The import java.util.Arrays cannot be resolved What am I doing wrong? The other import statements work…
Maya
  • 29
  • 3
1
2 3
12 13