Questions tagged [acm-java-libraries]

The ACM Java Libraries were produced by the ACM's Java Task Force with the aim of simplifying the teaching of Java to first-year undergraduate students.

The ACM Java Task Force Libraries and API were produced by the Association of Computing Machinery's Java Task Force with the aim of simplifying the teaching of Java to first-year undergraduate students.

As observed here and here, it may be necessary to compile under Java 1.5 to avoid regressions seen with later versions of Java.

113 questions
0
votes
0 answers

Java object not updating from KeyEvent?

I am currently working on a simple program that will highlight a square depending on the corresponding key press (q for top left, e for top right, etc), and I cannot seem to get the rectangles to trigger from my key events. The key events are…
Fenster
  • 11
  • 5
0
votes
1 answer

Java, constructor not working

So in a few words i made a class extending the RandomGenerator to randomly giving back PRIME, POWER OF 2(2,4,8,16,32,64,128 etc) , FIBONACCI AND SQUARE NUMBERS (1,4,9,16,25,36 etc). Then i made a simple program to call my class and giving back…
dhta
  • 1
  • 2
0
votes
1 answer

Using break to stop the moving lines in java

I am completely new to java and I have one problem I am trying to resolve. I am using ACM Library for my purpose. My goal is the following: Move Label 1 Move Label 2 Compare label 1's and label 2's position (when the text hits and its on each…
Dmitriy
  • 97
  • 3
  • 15
0
votes
0 answers

why applet is empty?

I'm new with java and only starting to "play" with it. I'm trying to start with graphics so I wrote this code: import java.awt.*; import acm.graphics.*; import acm.program.*; public class Gui extends GraphicsProgram { public void init…
Ariel
  • 165
  • 1
  • 3
  • 15
0
votes
2 answers

Program runs only at a specific pc

I had to write a program that creates credit card numbers. I wrote 3 classes, the main class, from where i can get the type and the length of the card (eg. Visa 15 digits), the luhn formula and one class where i create the card. From the main class…
ironik
  • 11
  • 3
0
votes
1 answer

Java programming, breakout game ball physics not behaving as expected

I am studying java with the book "The Art and Science of Java: An Introduction to Computer Science". One of the practice programs is to create a simple clone of the Breakout game. I am currently able to load the game, but am having issues with the…
0
votes
0 answers

Getting error 'test.Test class wasn't found in Test project'

So I'm watching Stanford's lectures on Programming Methodology and the professor has the code import acm.graphics.*; import acm.program.*; public class HelloProgram extends GraphicsProgram { public void run() { add( new GLabel("Hello…
Addem
  • 3,635
  • 3
  • 35
  • 58
0
votes
3 answers

Fibonacci's Code with ACM Library

Hello i have a question about this code i've found in this page. I have already done the Fibonacci by my own but i think this is better. The idea is that you have to choose "n" and the code works until you reach n. It works with the first numbers,…
BeatoJeronimo
  • 37
  • 1
  • 4
0
votes
1 answer

java how to create a grid of squares

I'm beginner to java and I'm doing a java project(maze solver) with a GUI. I need to build a grid of squares. I searched over the internet and unable to find any solutions, Someone told me that using java acm packages this can done easily. Please…
Guest
  • 53
  • 2
  • 15
0
votes
1 answer

GLabel trouble using acm package

So I'm trying to put a GLabel on the canvas, but the problem is it won't show up. I've been watching the Programming Methodology courses from Stanford and there they extend the acm packages, which I'm extending as well. My code looks exactly like…
0
votes
2 answers

How can i write java reverse string program in ACM Library

I need a java program which reverse a string with using methods. For example, input:-"hellojava" output:- "avajolleh"
davut
  • 41
  • 1
  • 7
0
votes
1 answer

acm.graphics APPLICATION_WIDTH and APPLICATION_HEIGHT constants not resizing window

I am taking an iTunesU class that uses Eric S. Roberts' book "The Art and Science of Java". The book claims that if I extend GraphicsProgram (part of the acm.program JAR) then I can simply declare constants named APPLICATION_WIDTH and…
0
votes
2 answers

Label refresh function does not work

I'm trying to setup a function that takes input from a user and prints it onto a label and updates it per entry. The updating would occur through removing the old label and then adding a label with the updated value. The text would be…
Quilty Kim
  • 455
  • 1
  • 4
  • 18
0
votes
3 answers

Move a ball on mouse click in Java

I'm trying to create the classic Breakout game as part of my programming assignment. I have to start moving the ball on a mouse click from the user. So I'm using a mouselistener to achieve that. The code below is just a smaller, simpler version of…
0
votes
1 answer

Problems with Brick Collision Detection in BreakOut game

I've done my first BreakOut Game while completing an assignment for Stanford University CS Online Course for java. However I noticed during play testing that when the ball sometimes hits a brick while travelling diagonally it ends up hitting several…