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
1
vote
0 answers

Why does this code not read in order? (graphics)

I ran the following code on eclipse. import acm.graphics.*; import acm.program.*; import java.awt.*; public class picture extends GraphicsProgram { public void run() { GRect sqr = new GRect(20, 20, 50, 50); …
Anonymous
  • 295
  • 2
  • 13
1
vote
1 answer

Type javax.swing.JComponent cannot be resolved

I'm using ACM library and working out the exercises present in "The Art and Science of Java" on my own. I have a simple program which should have added a Button to the screen but I'm getting a couple of error messages that I've not been able to…
BumbleBee
  • 11
  • 4
1
vote
1 answer

ACM Polygon No Border?

I'm a newbie to Java!!! :) Right now, I'm just perplexed about the ACM library's objects and it's functions. I want to create a GRect with a color of green. So I would probably do this: GRect rect = new GRect(0, 0, 50,…
mashedpotats
  • 324
  • 2
  • 16
1
vote
2 answers

Writing "println" fixes my code, how?

I was trying something in my cs lecture then suddenly i have experienced an interesting problem. this is my main code, public void run(){ setSize(800, 600); for(int i=0; i<= 30; i++){ elips el = new elips(); …
shanks
  • 342
  • 2
  • 4
  • 16
1
vote
0 answers

ACM java game loop breaking graphics

I have an issue with the ACM library. I am trying to create a game. In order to get the applet running in acm you need to make use of the run() method of a graphicsProgram class. I have a separate class, which has this graphics program as a global…
Daniel Hernandez
  • 635
  • 1
  • 11
  • 22
1
vote
2 answers

create a GUI with square grid using java acm packages

Please someone give me an example for create a GUI which contain a grid of squares (or buttons) using java acm packages.
Guest
  • 53
  • 2
  • 15
1
vote
0 answers

Java applet dispose window after closing applet

Just a quick question. I am creating an applet in Eclipse with Java. I run the program, the applet appears on the screen and everything is good. But when I hit close (cross on the applet window) it closes the window, and the clean grey window stays…
artpen
  • 25
  • 7
1
vote
4 answers

Return the position first position two strings are different

i can't figure out how i am supposed to return the first position org and check are different. Do i have to use substrings? import acm.program.*; public class CheckPasswords extends ConsoleProgram { public void run() { while(true) …
Sp00nman
  • 13
  • 4
1
vote
2 answers

Add(GObject obj) method doesn't draw the object on the applet

This is my code, it''s just a small part of a program for a Tic Tac Toe game. This part is supposed to draw the board on the applet, but everytime, nothing appears. import acm.program.*; import acm.graphics.*; import java.awt.*; public class TTTb…
user113377
  • 29
  • 6
1
vote
3 answers

Error wtih println: Location class,method println()

Im trying to create a printable on command promt board in order to manage to create a TicTacToe game in CMD. Although,when i create the class for my board and my cells, Java throws an error under my print and println saying me that: symbol: method…
HpdsbuΖt
  • 103
  • 2
  • 2
  • 9
1
vote
1 answer

refactoring input check for hangman in java with acm

I'm taking an online java course using the acm package, so the following syntax may not be "orthodox java". At any rate, hopefully, the point I'm making here comes through to those familiar with the package and otherwise: The code I have below…
Quilty Kim
  • 455
  • 1
  • 4
  • 18
1
vote
1 answer

println in Dialog with non-Latin symbol

So I want to println in ACM library dialog with a symbol from a non-English language in Java, but when I run it, only little squares appear. IODialog dialog = getDialog(); dialog.println("ზაზა");
1
vote
1 answer

Java error: cannot find symbol Rational()

I'm only using the acm package as per my instructor's preference. This program is supposed to allocate 10000 rational objects so that they will become garbage, and then calculate the free memory before and after the use of the garbage collector.…
user113377
  • 29
  • 6
1
vote
2 answers

Caesar cipher in Java ACM

I have a problem with caesar cipher in Java with ACM. Here's my code: import acm.program.*; public class Ceasar extends ConsoleProgram{ public void run() { println("This program encodes a message using a Caesar cipher."); int…
Panos
  • 77
  • 1
  • 7
1
vote
0 answers

Draw a house using the ACM library of Java

Well,i'm new to Java and these days i practice with the acm.library. I have to create a house with 2 windows,a door and a roof. But,i want them centered in their positions, regardless the width and height of the shapes. I just have centered the wall…
Socratεs
  • 27
  • 8