• Post Reply Bookmark Topic Watch Topic
  • New Topic

import acm.graphics.*;  RSS feed

 
Alfred Hitch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was seeing a tutorial on Java and they were able to run this program. But i have a few questions about this program:

import acm.graphics.*;
import acm.program.*;

public class Test extends GraphicsProgram{
public void run(){
add ( new GLabel ( "hello world", 100, 75));
}
}

I was told that a program needs to have the main method to start the program but this does not have any but it runs

and moreover i tried executing this program both on cmd line and on an eclipse, but it shows me that there are errors with the import statements,

So can any one explain me what's worng with the import statements.
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The program uses External Jars. So you would have to include them in your classpath or in the eclipse project.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was told that a program needs to have the main method to start the program but this does not have any but it runs

The GraphicsProgram class probably has a main method which this class inherits. I say "probably" because you didn't mention how this class is intended to be used.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!