1 Attachment(s)
Not sure if run() or main(String[] args)
Attachment 1254
Eclipse says that there's really nothing wrong with it and that it should work but when I try to run it, it doesn't display anything and shows that message on the bottom of the window. Do I need to use main(String[] args)? What is the difference? When do you use what?
Re: Not sure if run() or main(String[] args)
Take a look at the Tutorial for more information on Applets. I'm not sure what library you're using so you may have to dig into their docs more.
Re: Not sure if run() or main(String[] args)
I'm using acm. What do you mean dig into their docs? Is my question unique to every library?
Re: Not sure if run() or main(String[] args)
How do you initialize an applet? What is it telling me to do?
Re: Not sure if run() or main(String[] args)
Could you post the code and compiler message? (My phone chokes on the image :)
In general the acm package wants to replace the standard "way of doing things" with its own which it regards as less complicated. A reasonable aim, but you still need to know the basically arbitrary way it wants things done. Hence the need to read its documentation. (Or your teacher should have told you).
Re: Not sure if run() or main(String[] args)
Quote:
Originally Posted by
Brock Lee
I'm using acm. What do you mean dig into their docs? Is my question unique to every library?
This is a pretty prehistoric library but you need to take a look at the library docs. If the imports you're using don't start with java or javax then yes, you need to learn about the library above and beyond what Java itself offers.
Re: Not sure if run() or main(String[] args)
A standard applet is initalized by the browser or Applet Viewer in the init() method. When you create a class that extends from Applet, you are supposed to override the init() method. But, as everyone else has pointed out, the library you are using may require you to do something else to initialize it.