• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JApplet + JfreeChart for Line Chart

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jason Moors, you got the point in your saying.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic