4 Replies - 413 Views - Last Post: 30 April 2013 - 12:37 PM Rate Topic: -----

#1 IceHot  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 186
  • Joined: 28-August 12

creating a Java library from JFreeChart

Posted 29 April 2013 - 01:27 PM

I have a simple Java program that uses JFreeChart to display three simple XYCharts (based on saved data). I tried exporting the Java program into a .jar file, but was quickly shocked to learn that it took up more than 1MB of space! I was thinking to remedy this by unzipping JFreeChart to a folder, throwing away everything that I have not imported, zipping the folder up into a .zip. From there, I could just make it a .jar and just put it in Java's lib folder. However, when I tried that, it complains that my imports couldn't be resolved even though I have already included them via Eclipse! I don't think this may be because the packaging information from the original library might not be the same as that from the new library, and I don't know how to remedy this, and I think that I might have to fix that by hacking all the .class files! (gasps) I have heard of an alternative called ProGuard, but do not know how to use it to trim the JFreeChart library that I am using, and not my unused Objects. Also, I have tried excluding the
org.jfree.chart.
,
org.jfree.data.
part, but it doesn't seem to be working!!

Do you know if I have any other options besides trying out ProGuard? And, if ProGuard is the path of least resistance, how do I use it to trim the JFreeChart library (that is included in my program), but keep my unused Objects (I am using polymorphism...)

This post has been edited by IceHot: 29 April 2013 - 01:31 PM


Is This A Good Question/Topic? 0
  • +

Replies To: creating a Java library from JFreeChart

#2 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 797
  • View blog
  • Posts: 2,423
  • Joined: 29-July 11

Re: creating a Java library from JFreeChart

Posted 29 April 2013 - 01:47 PM

Just use the chart apis in javafx. It's already included in Java7, so there are no additional downloads. You just add whichever chart you want to a JFXPanel and then add it to your swing frame or component.
Was This Post Helpful? 0
  • +
  • -

#3 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8315
  • View blog
  • Posts: 31,836
  • Joined: 06-March 08

Re: creating a Java library from JFreeChart

Posted 29 April 2013 - 08:23 PM

We are not in the 80's anymore... 1MB is nothing you can store 16,000 on these on a $ 8.00 USB key

You can always unzip FreeChart and your Application on and empty directory and them jar everything together
Was This Post Helpful? 0
  • +
  • -

#4 IceHot  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 186
  • Joined: 28-August 12

Re: creating a Java library from JFreeChart

Posted 30 April 2013 - 10:22 AM

View Postfarrell2k, on 29 April 2013 - 03:47 PM, said:

Just use the chart apis in javafx. It's already included in Java7, so there are no additional downloads. You just add whichever chart you want to a JFXPanel and then add it to your swing frame or component.

I have Java 7, but couldn't find JavaFX on my computer. :(
Was This Post Helpful? 0
  • +
  • -

#5 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 797
  • View blog
  • Posts: 2,423
  • Joined: 29-July 11

Re: creating a Java library from JFreeChart

Posted 30 April 2013 - 12:37 PM

View PostIceHot, on 30 April 2013 - 05:22 PM, said:

View Postfarrell2k, on 29 April 2013 - 03:47 PM, said:

Just use the chart apis in javafx. It's already included in Java7, so there are no additional downloads. You just add whichever chart you want to a JFXPanel and then add it to your swing frame or component.

I have Java 7, but couldn't find JavaFX on my computer. :(/>


It's bundled with Java 7. JavaFX is just another API. I wrote a tutorial on getting started with it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1