I'm a newbie with java. 

Here is my simple code.

--------------------BEGIN----------------------
import java.util.*;
import java.applet.Applet;
import java.awt.Graphics;

public class HelloDateGui extends Applet {
  public void paint(Graphics g) {
    g.drawString("Hello, it's: ", 80, 50);
  /*  System.out.println(new Date()); This works but not as an applet*/
  }
}
--------------------END------------------------

How would I convert the last line so that the date will be viewed?

I tried compiling it with g.drawString(new Date(), 80, 50) and this is what
I encountered:

HelloDateGui.java:24: Incompatible type for method. Explicit cast needed to
convert java.util.Date to java.text.AttributedCharacterIterator.
    g.drawString(new Date(), 80, 50);


-- 
            .-------------------------------------------------------.
    .^.     | Ronneil R. Camara  | [EMAIL PROTECTED] |
    /V\     |--------------------| +632 6354086      +63917 5326993 |
   // \\    | "Anyone who has    `----------------------------------|
  /(   )\   | never made a mistake has never tried anything new."   |
   ^^-^^    `-------------------------------------------------------'
-
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to