Results 1 to 4 of 4
  1. #1
    danielmessick is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0

    Unhappy I need help fixing my Java applet, I keep getting errors.....

    In this applet, lines 37 and 47 keep getting errors and I'm not sure why...

    I'm trying to create this:
    http://farm3.static.flickr.com/2744/...05f177bc_o.jpg


    So far i have this, but I keep getting errors:

    /**
    * @(#)Main.java
    *
    * Main Applet application
    *
    * @author
    * @version 1.00 2010/3/7
    */

    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.util.*;
    public class Main extends JApplet
    implements Runnable{
    //JPanel jp=new ColorPanel();
    JLabel jl=new JLabel("hello");
    Random r=new Random();
    boolean painting=true;
    BufferedImage bi;

    public void init(){
    bi=new BufferedImage
    (getWidth(),getHeight(),
    BufferedImage.TYPE_INT_ARGB);
    setBackground(Color.white);
    //add(jp);
    Thread t=new Thread(this);
    t.start();
    }
    public void run(){
    for(int times=0;times<5;times++){
    if(painting){
    Graphics2D g2=bi.createGraphics();

    for(int i=0;i<200;i++){
    Wait.holdOn(10);
    g2.setColor
    (new Color
    (r.nextInt(251),
    r.nextInt(251),
    r.nextInt(251)));
    g2.drawLine(0, 0, 200-i, i);
    repaint();
    }
    for(int i=0;i<200;i++){
    Wait.holdOn(10);
    g2.setColor(getBackground());
    g2.drawLine(0, 0, i, 200-i);
    repaint();
    }
    g2.dispose();
    System.out.println("done");
    }
    }

    }
    public void paint(Graphics g){
    super.paint(g);

    g.drawImage
    (bi, 0, 0, getWidth(),getHeight(),null);
    }

    }

  2. #2
    danielmessick is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0

    Default

    sorry, nevermind, i've resolved this issue . . . . .

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,252
    Rep Power
    19

    Default

    Quote Originally Posted by danielmessick View Post
    sorry, nevermind, i've resolved this issue . . . . .
    After posting it all over. History here:
    How do i fix this Java applet ??????

    Moderator action requested.

    db

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,252
    Rep Power
    19

    Default

    [10 character limit]
    Last edited by DarrylBurke; 03-08-2010 at 05:48 AM. Reason: Wrong place

Similar Threads

  1. Replies: 10
    Last Post: 10-11-2009, 07:07 PM
  2. errors for a java applet
    By darren345 in forum Java Applets
    Replies: 3
    Last Post: 04-24-2009, 10:41 AM
  3. [SOLVED] I need help fixing an error
    By leonardjr in forum New To Java
    Replies: 8
    Last Post: 02-21-2009, 08:33 PM
  4. help with fixing my assignment.please...error
    By Jin-enigma-PL in forum New To Java
    Replies: 4
    Last Post: 02-05-2009, 12:12 AM
  5. Exception Error need help fixing
    By skinnybones in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 07:14 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
  •