In my application, the user can create and use multiple charts simultaneously. Currently, each chart is in its own JFrame with DISPOSE_ON_CLOSE set as its default close action.
When closing and disposing of a JFrame and ChartPanel,
is a call to dispose() sufficient to free up all resources, listeners, etc, or should I handle all the calls to components (such as the plot, the data series, tool tip generator, url generator, axis, etc) individually?
Thank you,
Stu
Closing and disposing a JFrame and ChartPanel
-
- Posts: 6
- Joined: Fri Aug 17, 2007 5:43 pm
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
As long as you don't keep any other references to the chart or its subcomponents, then disposing of the JFrame / ChartPanel should be enough to let the garbage collector do its work.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

