Re: Urgent Java Help Plzzzzzzz

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • udug86
    New Member
    • Apr 2008
    • 2

    Re: Urgent Java Help Plzzzzzzz

    import animax.Grafix;
    import java.awt.Color;

    class FlashingLight extends GrafixFlasher
    {

    int x = 100, y = 100;
    int w = 100, h = 100;

    public void draw ()
    {
    if(state==0) Grafix.out.setC olor(Color.red) ;
    if(state==1) Grafix.out.setC olor(Color.yell ow);

    Grafix.out.fill Oval(x,y,w,h);
    }
    }


    class Demo17B
    {
    public static void main (String[]args)

    {
    FlashingLight light = new FlashingLight() ;
    light.draw();
    light.flashCont inuosly();

    }
    }
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Yes, and your question is?

    kind regards,

    Jos

    Comment

    • udug86
      New Member
      • Apr 2008
      • 2

      #3
      Originally posted by JosAH
      Yes, and your question is?

      kind regards,

      Jos

      i'm awfully sorry. my question is that i'm tryin to design a traffic light that changes 3 different colors. i have tried everthing but doesnt seem to do . i'm not an expert in java just a beginer

      Comment

      • sukatoa
        Contributor
        • Nov 2007
        • 539

        #4
        Originally posted by udug86
        i'm awfully sorry. my question is that i'm tryin to design a traffic light that changes 3 different colors. i have tried everthing but doesnt seem to do . i'm not an expert in java just a beginer
        May we know your specific question?

        sukatoa...

        Comment

        • NitinSawant
          Contributor
          • Oct 2007
          • 271

          #5
          Hi, try following, I've modified ur program . . .


          <Removed by Admin>
          1.) Please do not attempt to spoonfeed, it is against the site rules
          2.) Use code tags everytime when posting code
          Last edited by r035198x; Apr 3 '08, 06:49 AM. Reason: spoon feeding is against site rules. Don't do it again

          Comment

          Working...