I am deploying my program in an applet and I have run into problems with overriding the ChartPanel class by placing a copied/modified version in an org.jfree.chart package within my project. Applets (in browsers) search the archive .jar files before searching files in your codebase, therefore opening the applet in a browser causes the applet to load the org.jfree.chart.ChartPanel class from the jfree .jar file instead of my copied/modified org.jfree.chart.ChartPanel class inside my project.
I have tried to place my modified ChartPanel class in a different package and remove the import org.jfree.chart.ChartPanel statement from my main class but I have not been able to check if it works yet due to caching problems with my browsers..
Has anyone run into the same problem before or have any ideas on how to fix it?
Thank you!
problem with overriding code and deploying an applet
What you are doing here is deepest and ugliest hacking. Dont do it.
If you cant use subclassing of the ChartPanel to bring your changes in, then you should copy the sources of that class, and place it into a different package. The ChartPanel is not referenced elsewhere (except in demo-code) so there is no sane need to try to replace the class the way you do it. Subclass or copy it under a new name/position.
And if you really have to change the code for the ChartPanel, then download the sources of JFreeChart, change the chart-panel there and then rebuild the jar. This is at least a lot cleaner than what you do right now.
If you cant use subclassing of the ChartPanel to bring your changes in, then you should copy the sources of that class, and place it into a different package. The ChartPanel is not referenced elsewhere (except in demo-code) so there is no sane need to try to replace the class the way you do it. Subclass or copy it under a new name/position.
And if you really have to change the code for the ChartPanel, then download the sources of JFreeChart, change the chart-panel there and then rebuild the jar. This is at least a lot cleaner than what you do right now.
My apologies. That way was recommended to me. I am new to working with open source projects so I am not familiar with protocol or best practices. And yes, I need to access some of the private fields and modify methods in the ChartPanel class so copying the source seemed the easiest way to access them.
Thank you for your input
Thank you for your input