Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JApplet + JfreeChart for Line Chart

 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I have drawn Linechart in the ApplicationFrame using jfree.chart package, but when doing the same thing in the JApplet giving the following error:

c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
java.lang.NoClassDefFoundError: org/jfree/chart/ChartPanel
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Can anyone help me regarding this ?
Thanks in advance.

Regards,
Varsha Pardeshi
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the JFreeChart library is missing from your applet classpath. What does the applet tag look like, and where do you keep the applet and JFreeChart classes?
 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
It looks like the JFreeChart library is missing from your applet classpath. What does the applet tag look like, and where do you keep the applet and JFreeChart classes?


Hello Ulf,
Thanks for reply. My structure is like this:
Source_Code : contains all the JSP & HTML pages
Source_Code/applet : applet java & class file
JfreeChart: c:/JfreeChart/lib/*.jar files

I have included the path of Jfreechart's jar file in the classpath environmental variable.

If I extending the myclass from ApplicationFrame the program is running absolutely fine. But if I am extending the class using JApplet I am getting the error which I have already mentioned.

can u please suggest me what setting has to be done to get these classes avaible for applet?

Regards,
varsha
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The normal classpath is not used for applets - you need to include all jar files in the "archive" attribute of the applet. You can find etails about that here.
 
Jason Moors
Ranch Hand
Posts: 188
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really need to use Applets? As there is a JSP Tag library called CeWolf which is based upon JFreeChart which enables you to create charts in your JSP pages.


http://cewolf.sourceforge.net/new/index.html

Jason
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Moors, you got the point in your saying.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic