Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JApplet will not run

  Asked By: Daryl    Date: Sep 04    Category: Java    Views: 644
  

I am attempting to run this as compiled into a class from HTML

import javax.swing.*;
/**
* Description of the Class
*
*@author john
*@created April 25, 2003
*/
public class getBusiness extends JApplet {

/**
* Description of the Method
*
*/

public getBusiness() { }


/**
* The main program for the getBusiness class
*
*@param arg The command line arguments
*/
public static void main(String[] arg) {
String title = "Find your business";
getBusiness mainGui = new getBusiness(title);
mainGui.drawMain();

}
}


The HML looks like this:




<APPLET SRC = "http://www.cadenzasoftware.com/bin/classfiles/" CODE
= "getBusiness.class" </APPLET>



and get this error:

load: out2eatmainAppl.class is not public or has no public
constructor.

java.lang.IllegalAccessException: Class sun.applet.AppletPanel can
not access a member of class out2eatmainAppl with modifiers ""



Why? Everything is public, the constructor is null.

What do I need to do to fix this?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Husani Chalthoum     Answered On: Sep 04

I have gotten it to init & start, but it then fails & points me to
some java  tutorial pages:

java.sun.com/.../example-
1dot4/tumbleClasses.jar tumbleImages.jar

Here's the code to start it al, main  if you will:

import javax.swing.*;
/**
* Description of the Class
*
*@author john
*@created April 25, 2003
*/
public class  BusMainGui extends JApplet {

/**
* Description of the Method
*/

public BusMainGui() { }


/**
* The main program  for the class
*/

//public static  void main(String[] arg)
public void  init() {


}


/**
* Description of the Method
*/
public void start() {

String title  = "Find Your Favorite Busness Here!";
BusMainGui mainGui = new BusMainGui(title);
mainGui.drawMain();

}
}


I want this to open a frame drawn by mainGui.drawMain().

Maybe I'm misunderstanding something. After the user makes a choice
from a list in this window, a bunch of SQL is run  then another window
needs to open. I'm quite willing to have the new page of data in a
new browser window or in the same window(and the user would hit the
back button to select new)


Does the frame in mainGui.drawMain() have to be another JApplet (r
should I just put all of the code in BusMainGui? And how do I get a
new results page to open?

 
Didn't find what you were looking for? Find more on JApplet will not run Or get search suggestion and latest updates.




Tagged: