Hi,
i'm using a very simple JFreeChart object. But after execution the following code the app will not return to system. What's wrong?
public static void main(String[] args) throws Exception
{
double[][] data = new double[][] {
{ 1.0, 4.0, 3.0, 5.0, 5.0, 7.0, 7.0, 8.0 },
{ 5.0, 7.0, 6.0, 8.0, 4.0, 4.0, 2.0, 1.0 },
{ 4.0, 3.0, 2.0, 3.0, 6.0, 3.0, 4.0, 3.0 }
};
DefaultCategoryDataset dataset = new DefaultCategoryDataset(data);
JFreeChart chart = ChartFactory.createLineChart("Line Chart Demo 1",
"Category",
"Value",
dataset,
true);
ChartUtilities.saveChartAsPNG(new File("test.png"), chart, 400, 300);
System.out.println("done");
}
Chart object is not released!
Re: Chart object is not released!
My guess is that this is related to the following Java bug (or one of its many related bugs):
http://developer.java.sun.com/developer ... 30718.html
But I'm guessing, because I can't see the exact cause yet.
Regards,
DG
http://developer.java.sun.com/developer ... 30718.html
But I'm guessing, because I can't see the exact cause yet.
Regards,
DG
Re: Chart object is not released!
The descibed bug is already fixed and i'm using JVM 1.3.1_05.
Regards,
Werner
Regards,
Werner
Re: Chart object is not released!
Hi Werner,
I've tried out two of the test programs on the three JVMs I have handy (all on Linux). Both fail on 1.3.0_02 and 1.3.1_04 but work on 1.4.0_01. Can you try them out on your JVM?
The bug report mentions the SystemColor class as one cause of the problem. This is used in the JFreeChartConstants class, so this might be the link.
Regards,
DG.
*** Test1.java **********************************
import java.awt.*;
public class Test {
public static void main(String[] args) {
Toolkit.getDefaultToolkit();
System.out.println("Done");
}
}
*** Test2.java **********************************
public class Test2 {
static public void main(String args[]) {
java.awt.Color color = java.awt.SystemColor.window;
System.out.println("Done");
}
}
I've tried out two of the test programs on the three JVMs I have handy (all on Linux). Both fail on 1.3.0_02 and 1.3.1_04 but work on 1.4.0_01. Can you try them out on your JVM?
The bug report mentions the SystemColor class as one cause of the problem. This is used in the JFreeChartConstants class, so this might be the link.
Regards,
DG.
*** Test1.java **********************************
import java.awt.*;
public class Test {
public static void main(String[] args) {
Toolkit.getDefaultToolkit();
System.out.println("Done");
}
}
*** Test2.java **********************************
public class Test2 {
static public void main(String args[]) {
java.awt.Color color = java.awt.SystemColor.window;
System.out.println("Done");
}
}
Re: Chart object is not released!
Hi Dave,
i've tried 1.3.1_05 and the brand new 1.3.1_06 on Win2000. Unfortunately Test and Test2 fails. Now i've tried 1.4.1 and all works fine. Maybe this is the time to switch to 1.4.1.
Thanks for your help.
Regards,
Werner
i've tried 1.3.1_05 and the brand new 1.3.1_06 on Win2000. Unfortunately Test and Test2 fails. Now i've tried 1.4.1 and all works fine. Maybe this is the time to switch to 1.4.1.
Thanks for your help.
Regards,
Werner