Japplet

Discussion in 'Java' started by d.schulz81@gmx.net, Dec 2, 2005.

  1. Guest

    HI there

    currently we are trying to convert a java gui program into an applet.
    now that we are inheriting from JApplet we have the following error
    message:
    (formerly the program inherited from JComponent)

    Laden: Instanz von
    freestyleLearningGroup.independent.util.FLGPlotter2D.class kann nicht
    erstellt werden.
    java.lang.InstantiationException:
    freestyleLearningGroup.independent.util.FLGPlotter2D
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


    Means the instance could not be created....

    Is there a problem running threads in Applets?
    What else could cause the failure?

    Dennis
     
    , Dec 2, 2005
    #1
    1. Advertising

  2. Guest

    No there is no problem running threads in Applets.

    This is from the API documentation of InstantiationException.

    Thrown when an application tries to create an instance of a class using
    the newInstance method in class Class, but the specified class object
    cannot be instantiated because it is an interface or is an abstract
    class.
     
    , Dec 2, 2005
    #2
    1. Advertising

  3. zero Guest

    wrote in news:1133547988.367519.290930
    @g47g2000cwa.googlegroups.com:

    > HI there
    >
    > currently we are trying to convert a java gui program into an applet.
    > now that we are inheriting from JApplet we have the following error
    > message:
    > (formerly the program inherited from JComponent)
    >
    > Laden: Instanz von
    > freestyleLearningGroup.independent.util.FLGPlotter2D.class kann nicht
    > erstellt werden.
    > java.lang.InstantiationException:
    > freestyleLearningGroup.independent.util.FLGPlotter2D
    > at java.lang.Class.newInstance0(Unknown Source)
    > at java.lang.Class.newInstance(Unknown Source)
    > at sun.applet.AppletPanel.createApplet(Unknown Source)
    > at sun.applet.AppletPanel.runLoader(Unknown Source)
    > at sun.applet.AppletPanel.run(Unknown Source)
    > at java.lang.Thread.run(Unknown Source)
    >
    >
    > Means the instance could not be created....
    >
    > Is there a problem running threads in Applets?
    > What else could cause the failure?
    >
    > Dennis
    >
    >


    try posting the code that generates this error

    --
    Beware the False Authority Syndrome
     
    zero, Dec 2, 2005
    #3
  4. Guest

    this is the beginning, ich guess all of the code code is to huge to
    post

    public class FLGPlotter2D extends JApplet implements Runnable {

    VARS...

    public FLGPlotter2D(FLGFunctionGroup2D functionGroup,
    FLGPolygonGroup2D polygonGroup, String xAxisName, String
    yAxisName) {
    setDataGroups(functionGroup, polygonGroup);
    this.xAxisLabel = new JLabel(xAxisName);
    this.xAxisLabel.setSize(this.xAxisLabel.getPreferredSize());
    this.yAxisLabel = new JLabel(yAxisName);
    this.yAxisLabel.setSize(this.yAxisLabel.getPreferredSize());
    //setBorder(FLGBorderFactory.emptyLoweredBevel10);
    }

    /**
    * Erzeugt einen 2D Plotter mit der spezifizierten Funktionsgruppe
    und den
    * Standard-Achsenbeschriftungen <code>"x"</code> und
    <code>"y"</code>.
    * @param functionGroup die Funktionen dieses 2D Plotters.
    */
    public FLGPlotter2D(FLGFunctionGroup2D functionGroup) {
    this(functionGroup, null, "x", "y");
    }

    /**
    * Erzeugt einen 2D Plotter mit der spezifizierten Funktionsgruppe
    und den spezifizierten Achsenbeschriftungen.
    * @param functionGroup die Funktionen dieses 2D Plotters.
    * @param xAxisName die <i>x</i>-Achsenbezeichnung.
    * @param yAxisName die <i>y</i>-Achsenbezeichnung.
    */
    public FLGPlotter2D(FLGFunctionGroup2D functionGroup, String
    xAxisName, String yAxisName) {
    this(functionGroup, null, xAxisName, yAxisName);
    }

    /**
    * Erzeugt einen 2D Plotter mit der spezifizierten Polygonengruppe
    und den
    * Standard-Achsenbeschriftungen <code>"x"</code> und
    <code>"y"</code>.
    * @param polygonGroup die Polygone dieses 2D Plotters.
    */
    public FLGPlotter2D(FLGPolygonGroup2D polygonGroup) {
    this(null, polygonGroup, "x", "y");
    }

    /**
    * Erzeugt einen 2D Plotter mit der spezifizierten Polygonengruppe
    und den spezifizierten Achsenbeschriftungen.
    * @param polygonGroup die Polygone dieses 2D Plotters.
    * @param xAxisName die <i>x</i>-Achsenbezeichnung.
    * @param yAxisName die <i>y</i>-Achsenbezeichnung.
    */
    public FLGPlotter2D(FLGPolygonGroup2D polygonGroup, String
    xAxisName, String yAxisName) {
    this(null, polygonGroup, xAxisName, yAxisName);
    }
     
    , Dec 4, 2005
    #4
  5. wrote:

    > currently we are trying to convert a java gui program into an applet.


    Why? JWS can allow the end user to launch a Java application
    from a web-link.

    Better,
    - JWS can update automatically
    - JWS includes automatic support for Java JRE versionning.
    - the app. needs no conversion to applet (some ways of doing
    things in applications are very different to applets)
    - it avoids all the problems with applets

    --
    Andrew Thompson
    physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
     
    Andrew Thompson, Dec 7, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John C. Bollinger

    Re: JApplet + API question

    John C. Bollinger, Jun 27, 2003, in forum: Java
    Replies:
    0
    Views:
    1,093
    John C. Bollinger
    Jun 27, 2003
  2. Eric Olander

    Re: JApplet + API question

    Eric Olander, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    484
    Sudsy
    Jul 8, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    434
    Andrew Thompson
    Aug 5, 2003
  4. Cheok Yan Cheng

    ImageIcon.paintIcon wont work in JApplet

    Cheok Yan Cheng, Aug 13, 2003, in forum: Java
    Replies:
    0
    Views:
    1,781
    Cheok Yan Cheng
    Aug 13, 2003
  5. Maria Laura Re

    Help With JApplet Problem!

    Maria Laura Re, Dec 7, 2003, in forum: Java
    Replies:
    1
    Views:
    2,526
    Andrew Thompson
    Dec 7, 2003
Loading...

Share This Page