Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Applets and the fly likes Applet containing pie chart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet containing pie chart" Watch "Applet containing pie chart" New topic
Author

Applet containing pie chart

Cheryl Irwin
Greenhorn

Joined: Oct 20, 2012
Posts: 8
I am trying to create a pie chart to add in to an html document, but when I try to run the html I just get an error. Can anyone give me a clue as to why it is not working? Thanks in advance!



My html applet statement is:
<applet code="PieChartApplet.class" width = 200 height = 200></applet>
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I think the error message is supposed to give you that clue. But at present you're the only one who can see it, so nobody else has a clue.

In other words -- TellTheDetails (<== follow that link). In particular, what does the error message say?
Cheryl Irwin
Greenhorn

Joined: Oct 20, 2012
Posts: 8
I am just getting an empty box that says error:click for details, when I click it just says error application failed to run. Clicking details tells me it can't find my class. I checked my class name and the java file and html file are in the same folder.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

When you say "the java file" I assume you mean the source code, the file named "PieChartApplet.java"? That isn't what the browser wants to download. It needs the compiled class, the one named "PieChartApplet.class".
Cheryl Irwin
Greenhorn

Joined: Oct 20, 2012
Posts: 8
Paul Clapham wrote:When you say "the java file" I assume you mean the source code, the file named "PieChartApplet.java"? That isn't what the browser wants to download. It needs the compiled class, the one named "PieChartApplet.class".


It says it can't find PieChartApplet.class
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41128
    
  45
Post the APPLET tag, and the layout of the various files within the directory hierarchy.


Ping & DNS - my free Android networking tools app
Cheryl Irwin
Greenhorn

Joined: Oct 20, 2012
Posts: 8
OK the applet tag is

<applet code="PieChartApplet.class" width = 200 height = 200></applet>

The file PieChartApplet.java and index.html are in the same folder named PieChartApplet. They are not in sub folders or anything.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41128
    
  45
Can you download the PieChartApplet.class through the browser, by entering something like "http://www.whateverthedomainis.com/whatevertheappnameis/whateverthedirectoryis/PieChartApplet.class" ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Cheryl Irwin wrote:The file PieChartApplet.java and index.html are in the same folder named PieChartApplet.


As I said earlier, you need PieChartApplet.class in that folder. Normally if you compile your PieChartApplet.java code, the PieChartApplet.class file will be put there, but perhaps you're compiling the code in a different way, like using an IDE or something. So find PieChartApplet.class, wherever it went, and move it into the folder with index.html.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet containing pie chart
 
Similar Threads
applets - pie charts
please help ...urgent
Applets...pie chart from user inpiut
slowing down movement in an applet.... doesn't have anything to do with the applet.
Moving an object such as an arc.