Search:

Type: Posts; User: curmudgeon

Search: Search took 0.08 seconds.

  1. Replies
    7
    Views
    1,895

    Re: Java Applet Beginner

    You're welcome! Also note that there are other ways to change a number into a String, one being String.valueOf(dbl).
  2. Replies
    7
    Views
    1,895

    Re: Java Applet Beginner

    Ah, you need to translate it into a String. One "cheat" is to create a String on the spot by concatenating the numeric value with the empty String literal, "". i.e.,



    g. drawString("" + dbl,...
  3. Replies
    7
    Views
    1,895

    Re: Java Applet Beginner

    You get the double returned and put it into a double variable same as you normally would.

    double dbl = distance(x1, y1, x2, y2);

    Then use the dbl variable in drawString.
  4. Replies
    7
    Views
    1,895

    Re: Java Applet Beginner

    Does it compile? Does it run? Does it do what you want it to do?

    One hint: your instructor told you to have the paint method call the other method -- you'll want to do something with the double...
Results 1 to 4 of 4