Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

    package try;



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



    public class work2 extends Applet
    {


    public void paint(Graphics g)
    {
    try
    {
    g.setColor(Color.gray);
    g.fillRect(210,200,340,210);
    g.setColor(Color.blue);
    g.fillRect(210,200,340,25);
    g.setColor(Color.white);
    g.fillRect(240,350,280,25);
    g.setColor(Color.black);
    g.drawString("The program is being loaded..... ",235,315);
    g.setColor(Color.white);
    g.drawString("Java Project ",218,215);

    for(int i=242;i<520;i=i+14)
    {
    g.setColor(Color.green);
    g.fillRect(i,350,12,25);
    Thread.sleep(1000);

    }




    }catch(Exception e)
    {}

    }

    }


    // this applet is correctly running in Bluej but not in netbeans 7.3.1
    //it shows the error "Applet not initialized"
    //but if i remove the thread.sleep function and all the loops.. and run a simple applet with just a simple rectangle.. its running correctly then


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

    Please post your code in code tags.

    Are you following a tutorial or textbook to write this code? If so, can you provide a reference? If not, I suggest you find one, a better one that uses the modern components and correct techniques. Try the Java Applet Tutorial.

  3. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

    I have studied core java in my 11th n 12th at school level because i am from icse board.
    And I am also learning java from an institute presently as my training course of b.tech.....

    This applet is correctly running in Bluej but not in netbeans 7.3.1
    It shows the error "Applet not initialized"
    but if i remove the thread.sleep function and all the loops.. and run a simple applet with just a simple rectangle.. its running correctly then

    // program code
    package try;
     
    import java.awt.*;
    import java.applet.*;
     
    public class work2 extends Applet
    {
     
     
    public void paint(Graphics g)
    {
    try
    {
    g.setColor(Color.gray);
    g.fillRect(210,200,340,210);
    g.setColor(Color.blue);
    g.fillRect(210,200,340,25);
    g.setColor(Color.white);
    g.fillRect(240,350,280,25);
    g.setColor(Color.black);
    g.drawString("The program is being loaded..... ",235,315);
    g.setColor(Color.white);
    g.drawString("Java Project ",218,215);
     
    for(int i=242;i<520;i=i+14)
    {
    g.setColor(Color.green);
    g.fillRect(i,350,12,25);
    Thread.sleep(1000);
     
    }
     
     
     
     
    }catch(Exception e)
    {}
     
    }
     
    }

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

    Please don't start duplicate topics. Add to and continue in the original as needed.
    Last edited by jps; August 16th, 2013 at 03:25 PM. Reason: removed link to the "other" post

  5. #5
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: My applet is working in bluej but giving an error "Applet not initialized" when i try to run it in netbeans

    Quote Originally Posted by GregBrannon View Post
    Please don't start duplicate topics.
    Threads merged

Similar Threads

  1. Java applet error: "Blocked Exception"
    By kinkita in forum Java Applets
    Replies: 7
    Last Post: July 12th, 2013, 01:11 PM
  2. Replies: 3
    Last Post: July 3rd, 2013, 08:25 AM
  3. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  4. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  5. Replies: 4
    Last Post: October 20th, 2011, 11:26 AM