Re: beginner's question



Eclipse can either link to Javadocs on the internet or to downloaded local copies. For either,
you go into the Java Build Path properties for that library (starting with rt.jar!) and set the Javadoc
location. For a Java 5 rt.jar, you can set the Javadoc location to http://java.sun.com/j2se/1.5.0/docs/api/
..
You can also download the documentation from sun.java,com and unzip it into a location on your
computer. I do that for the APIs I use most, because I sometimes work on code when I don't
have Internet connectivity.

--
TideRider


"Jacky Luk" <jl@xxxxxxxxxx> wrote in message news:451248fa@xxxxxxxxxxxx
|
| "Ian Shef" <invalid@xxxxxxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:Xns984485A746F71vaj4088ianshef@xxxxxxxxxxxxxxxxxx
| > "Jacky Luk" <jl@xxxxxxxxxx> wrote in news:45116ca0$1@xxxxxxxxx:
| >
| >> import java.awt.Graphics;
| >>
| >> public class printtest extends java.applet.Applet
| >> {
| >> public void init()
| >> {
| >> }
| >>
| >> public void paint (Graphics g)
| >> {
| >> g.drawString ("Hello from java!", 60, 30);
| >> }
| >>
| >> public static void main (String args)
| >> {
| >>
| >> }
| >> }
| >> ===============================
| >> java.lang.NoSuchMethodError: main
| >> Exception in thread "main"
| >>
| >> What happened?
| >> Thanks
| >> Jack
| >
| > 1)
| > The main method must be declared public and static. Good!
| > It must not return any value. Good!
| > It must accept a String array as a parameter. Oops! You have a String,
| > not
| > a String array.
| >
| > The method declaration must look like the following:
| >
| > public static void main(String args[])
| >
| > The above has been partially copied out of the javadocs for "java".
| > Get the javadocs and use them. They are your friend.
| >
| > 2)
| > Note for the future: When java tells you that it cannot find a method, it
| > is vital to remeber that the method must match both in name and in
| > signature. Method definitions don't match method calls unless a method of
| > the correct name can be found that has a parameter list that also matches
| > the one used for the call.
| >
| > 3)
| > If I saw an experienced java programmer writing this program, I might
| > figure that they are writing a mixed application/applet or otherwise doing
| > something clever -- maybe providing a way to test an applet without
| > requiring an applet viewer. However, when someone who describes themself
| > as a beginner writes this way, I get concerned.
| >
| > Your class extends Applet, indicating that you intend this program to be
| > an
| > Applet. However, you have a method "main", indicating that you intend
| > this
| > program to be an application. Furthermore, you used "java" to run it,
| > again indicating that your intent was for an application.
| >
| > If your intent was cleverness or a mixed application/applet, please
| > forgive
| > me. Otherwise, you need to re-think what you are doing and decide whether
| > you want an application or an applet. Then rethink your design.
| >
| > Best wishes!
| >
| >
| >
| > --
| > Ian Shef 805/F6 * These are my personal opinions
| > Raytheon Company * and not those of my employer.
| > PO Box 11337 *
| > Tucson, AZ 85734-1337 *
|
| How do I download java documentation directly from eclipse? I couldn't find
| my way out at java.sun.com
| Thanks
| Jack
|
|


.



Relevant Pages

  • (no subject)
    ... It is a quick download. ... Well, I do not know java so super well, but do know IE ... I created an installer that downloads the file to ... >>> your local drive and you can load the applet from there. ...
    (comp.security.misc)
  • Re: Need help with redirecting - IE6 XP Service Pack 1
    ... The product I have is totally written in java 1.1 and there is ... It is a quick download. ... I also know browser security pretty ... I have a product that is an applet that is composed of jar ...
    (comp.security.misc)
  • Re: IE 6.0 shuts down when loading certain pages
    ... Test Java: http://www.fitwise.com/testjava.asp ... > websites that cause the browswer to shut down all load an applet. ... download a copy of LSPFIX from any of the following ... >>> Dealing with Unwanted Malware, Parasites, Toolbars and Search ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • (no subject)
    ... The product I have is totally written in java 1.1 and there is ... It is a quick download. ... I also know browser security pretty ... I have a product that is an applet that is composed of jar ...
    (comp.security.misc)
  • Technical information about the vulnerabilities fixed by MS-02-52
    ... The patch doesn't fix all of the vulnerabilities we reported, ... Java support in the Internet Zone even after applying the patch gives the ... possibility for a malicious Java Applet to gain control over the system. ... Our original report and information regarding the remaining Java ...
    (NT-Bugtraq)