Results 1 to 7 of 7

Thread: Smiley Face

  1. #1
    eppoair2 is offline Member
    Join Date
    Nov 2010
    Location
    Virginia
    Posts
    14
    Rep Power
    0

    Default Smiley Face

    Hello There,

    I am trying to create a smiley face using Japplet, but nothing comes up when I run the program

    here are my codes

    import java.awt.*;
    import java.applet.*;

    public class NewJApplet2 extends Applet {

    public void paint(Graphics g)
    {
    g.setColor(Color.yellow);
    g.fillOval(50, 50, 75, 75);

    g.setColor(Color.black);
    g.fillOval(65, 70, 15, 15);
    g.fillOval(95, 70, 15, 15);
    g.drawArc(70, 90, 40,15, 180, 180);
    }

    }


    Please advise what should i modify

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,690
    Rep Power
    8

    Default Re: Smiley Face

    How are you running your applet? How big is it? What do you see?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    eppoair2 is offline Member
    Join Date
    Nov 2010
    Location
    Virginia
    Posts
    14
    Rep Power
    0

    Default Re: Smiley Face

    Thank you for your interest to help me:
    1. I am trying to run the applet through my IDE ( Netbeans and Jcreator )
    2 .the applet is not big: it should occupy a quarter of the screen max.
    3. I will attach a screenshot for the dislay
    Attached Thumbnails Attached Thumbnails Smiley Face-applet.jpg  

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,690
    Rep Power
    8

    Default Re: Smiley Face

    I'd recommend putting a print statement in your paint method to figure out whether it's ever actually being called.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Smiley Face

    Where does the "Welcome to Java!" text in your screenshot come from? I suspect that you have some old .class file lying on the classpath, and haven't compiled the new NewJApplet2.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. next book after john smiley's
    By johnpipes in forum New To Java
    Replies: 1
    Last Post: 11-18-2011, 08:27 PM
  2. Face Dections CTS
    By rockos in forum Advanced Java
    Replies: 2
    Last Post: 09-17-2011, 09:40 AM
  3. Java Smiley App
    By hawken89 in forum Java Applets
    Replies: 0
    Last Post: 03-01-2011, 11:47 AM
  4. Solr- New face of Search
    By petermatilda in forum Java Software
    Replies: 1
    Last Post: 08-30-2010, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •