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
1
vote
1 answer

Undefined for a type (of turtle)

Hi Im doing an assignment for my class but got some trouble from the last part. This part I was making code to draw some phases and put in a world with a pic background and some customed features. The phases' code is the problem I believe. Can you…
Dave Phan
  • 31
  • 4
1
vote
0 answers

Dr. Java: Static Error: This class does not have a static void main method accepting String[] when running program

I am taking my second Java class ever, and was told by my professor to use Dr. Java. We have started learning GUI, and he has given us some sample code as examples: import javafx.application.Application; import javafx.scene.*; import…
btrx.vvnn
  • 11
  • 1
1
vote
0 answers

repaint works only for some code

So i'm trying to make a game where a block falls from the sky and you have to dodge it. I use keylistener to move the player, and a timer to move the block that falls down. I can move the player just fine, repaint works there; it's the red block…
1
vote
0 answers

Moving images on GUI

I'm currently doing a Connect Four game and I would appreciate any help with adding and moving the Game pieces. So I made the game piece into an image and want to add it to the game board which is a JLabel picture and then move the game piece on…
Forrest Y
  • 11
  • 2
1
vote
1 answer

"The public type must be defined in its own file" but the file name and the class name is the same

import java.util.StringTokenizer; public class josimarleewords { private static String[] tokenize(String str) { StringTokenizer tokenizer = new StringTokenizer(str); String[] arr = new String[tokenizer.countTokens()]; …
1
vote
1 answer

Make both sorting algorithms put the values in descending order. Then create drive class to test the two algorithms

I am extremely confused on how to reverse these sorting methods. Any help would be appreciated. I have looked up and tried researching but I could not find anything to do with this type of comparable list. public class Sorting { public static…
azamaryk
  • 13
  • 2
1
vote
0 answers

Having Issues with Text-based Java Game in DrJava

Menus aren't linking, after the first menu, it goes back to the beginning, also trying to figure out how to turn it into a wave system where only a few enemies come at a time, once those enemies have been defeated you can move onto the next wave and…
Craser G
  • 11
  • 4
1
vote
0 answers

drjava ArrayList not working

For my programming coursework I have to create a game where there are items in rooms. To create these items I want to make an array list, but I keep getting this problem and I don't know how to fix it. It keeps stating: Error:
UOPYAN
  • 11
  • 1
1
vote
1 answer

How to determine what commands DrJava is executing?

Q: How can I determine what commands DrJava is actually executing when I click "Compile"? CONTEXT: I wrote a simple test program which used an external .jar. I added the path to that .jar in DrJava via Edit > Preferences > Resource Locations > Extra…
lowndrul
  • 3,715
  • 7
  • 36
  • 54
1
vote
2 answers

What does "Illegal Class Literal" mean?

Just started using DrJava, and I'm getting an Illegal Class Literal error when I try to run my code. My code compiles, and no issue arises until runtime. Even just the following leads to the error when I run 'java Percolation(5)' in the interaction…
jtimmins
  • 367
  • 3
  • 13
1
vote
0 answers

Problems with DrJava's interactions pane, eclipse plug-in

I am using DrJava's plugin for Eclipse (4.3), and the interactions pane "view" is acting funny. (Very similar to this guy from 2011). Unfortunately, his question has no responses. I also found this, however it's from 2004, and hasn't solved my…
Raghav Rao
  • 11
  • 4
1
vote
3 answers

Java Type mismatch: cannot convert from java.lang.Object

I am working out of the blue pelican java textbook and using drjava. I am currently working on the Lesson 43 Big Bucks project basically I have to use this BankAccount class: public class BankAccount { public BankAccount(String nm, double amt) …
derpyherp
  • 455
  • 4
  • 9
  • 18
1
vote
1 answer

Writing a method for selling Passes, and another Method for selling tickets in JAVA

Hello I am trying to write a code that satisfies the following output: Here are the booths at the start:    Ticket booth with 5 passes and 50 tickets    Ticket booth with 1 passes and 10 tickets Booth 1 has made $43.0 Booth 2 has made $20.5 Here are…
Alex Chavez
  • 185
  • 1
  • 10
1
vote
4 answers

How do I count capitals as abbreviations from a text file

So my program is supposed to read a text file which contains tweet post (one tweet per line). It should output the number of hashtags (any word beginning with #) and name tags (any word beginning with @), and the difficult part: it should check for…
user2932716
1
vote
5 answers

Can somebody explain i+++x?

I was messing with i++ when I stumbled upon i+++[another expression]. I went and tested it in DrJava: > int i; > i++ 0 > i+++1 2 > i+++1 3 > i+++2 5 > i+++1 5 > ++i+1 7 > ++i+1 8 > ++i+1 9 > ++i+2 11 Later, I did this: > int i; > i+++(++i); >…
oldmud0
  • 147
  • 2
  • 11
1 2
3
12 13