Results 1 to 2 of 2
  1. #1
    sphrr is offline Member
    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Default Start: applet not initialized

    Hi

    I need help getting my applet to initialize. I am using BlueJ and any time I try to run the applet it give mes the error Start:applet not initialized. I will post my code below, please help!

    Java Code:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.event.ActionListener.*;
    import java.awt.event.TextListener.*;
    import javax.swing.*;
    public abstract class GradeAverage extends JApplet
    implements ActionListener, TextListener{
    Button Ok=new Button("Ok");
    Button Cancel=new Button("cancel");
    TextField Math=new TextField("Math Grade",2);
    TextField Science=new TextField("Science Grade",2);
    TextField SocialStudies=new TextField("Social Studies Grade",2);
    TextField English=new TextField("English Grade",2);
    TextField Elective=new TextField("Elective Grade",2);
    TextField Elective2=new TextField("2nd Elective Grade",2);
    TextArea message=new TextArea();
    public void init(){
    GridBagLayout gbl=new GridBagLayout();
    setLayout(gbl);
    GridBagConstraints c=new GridBagConstraints();
    c.anchor=GridBagConstraints.WEST;
    c.weightx=2.0;
    c.weighty=2.0;
    c.fill=GridBagConstraints.HORIZONTAL;
    c.insets=new Insets(10,10,10,10);
    gbl.setConstraints(Math,c); add(Math);
    c.fill=GridBagConstraints.NONE;
    gbl.setConstraints(Science,c); add(Science);
    c.fill=GridBagConstraints.HORIZONTAL;
    gbl.setConstraints(SocialStudies,c); add(SocialStudies);
    c.gridy=1;
    gbl.setConstraints(English,c); add(English);
    c.gridy=2;
    gbl.setConstraints(Elective,c); add(Elective);
    c.fill=GridBagConstraints.NONE;
    gbl.setConstraints(Elective2,c); add(Elective2);
    c.gridy=3;
    c.anchor=GridBagConstraints.CENTER;
    gbl.setConstraints(Ok,c); add(Ok);
    gbl.setConstraints(Cancel,c); add(Cancel);
    c.gridy=4;
    c.gridwidth=3;
    c.fill=GridBagConstraints.BOTH;
    gbl.setConstraints(message,c); add(message);
    Math.addTextListener(this);
    Science.addTextListener(this);
    SocialStudies.addTextListener(this);
    English.addTextListener(this);
    Elective.addTextListener(this);
    Elective2.addTextListener(this);
    Ok.addActionListener(this);
    Cancel.addActionListener(this);
    }
    public void actionPerformed(ActionEvent event){
    Object Source=event.getSource();
    if(Source==Ok){
    double gpa=(Double.parseDouble(Math.getText())+ Double.parseDouble(Science.getText())+Double.parseDouble(SocialStudies.getText())+Double.parseDouble(English.getText())+Double.parseDouble(Elective.getText())+Double.parseDouble(Elective2.getText())/6);
    message.setText(String.valueOf(gpa));
    if(Source==Cancel){
    message.setText(" ");
    Math.setText("Math Grade");
    Science.setText("Science Grade");
    SocialStudies.setText("Social Studies Grade");
    English.setText("English Grade");
    Elective.setText("Elective Grade");
    Elective2.setText("2nd Elective Grade");
    }
    }}}
    Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,409
    Rep Power
    20

    Default Re: Start: applet not initialized

    Recommended reading: Code Conventions for the Java Programming Language: Contents

    After you've gone through that, either edit your post or re-post the code. As it stands, it's not readable.

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

Similar Threads

  1. Eclipse - Start: Applet not initialized - Help?
    By HausOf in forum New To Java
    Replies: 4
    Last Post: 01-31-2013, 04:16 PM
  2. Start: Applet not initialized
    By Djblacklantern in forum Java Applets
    Replies: 2
    Last Post: 11-15-2012, 08:24 AM
  3. Applet won't start
    By David2010 in forum New To Java
    Replies: 5
    Last Post: 07-14-2009, 05:32 AM
  4. [SOLVED] "start: applet not initialized"
    By DenniGa in forum Java Applets
    Replies: 3
    Last Post: 02-24-2009, 02:10 AM
  5. how to start a Web Java applet without a webbrowser
    By racker79 in forum Java Applets
    Replies: 3
    Last Post: 09-22-2008, 06:30 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
  •