Hey,
I have created an application that produces multiple charts. I want to close individual charts without exiting the program. i have tried overriding the default...
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
(i'm not sure if thats exactly right but you get wat i mean)
I was just wondering if something is stopping me overriding. i think my code is right as it works for a window created without any Jfreechart.
Any advice would be much appreciated.
T
closing frame
I'm not sure I understand what you are asking, so the stuff below might not apply.
ChartFrame is just a subclass of JFrame. Its constructor sets the default close operation to dispose(). That should only destroy that particular frame. So unless it was the last frame still open your application will still be running.
In anycase, there is nothing in ChartFrame that should stop you from changing the default close operation.
I hope that helps.
ChartFrame is just a subclass of JFrame. Its constructor sets the default close operation to dispose(). That should only destroy that particular frame. So unless it was the last frame still open your application will still be running.
In anycase, there is nothing in ChartFrame that should stop you from changing the default close operation.
I hope that helps.
I think the default operation is to EXIT_ON_CLOSE. if i don't specify the setDefaultClo.... and i press the x the whole application closes.
When i run my application i prompt the user for inputs using textfields and buttons and such. When the user presses a button a graph appears. The user can then push a different button and a different graph will appear... and so on allowing alot of graphs to be generated.
When the x in the corner of the frame is pressed on any graph the application crashes... i'd like to override this so that just the graph wished to be closed is disposed and the application keeps running. I've tried overriding it but there is no response. I'm just a bit puzzled thats all.
When i run my application i prompt the user for inputs using textfields and buttons and such. When the user presses a button a graph appears. The user can then push a different button and a different graph will appear... and so on allowing alot of graphs to be generated.
When the x in the corner of the frame is pressed on any graph the application crashes... i'd like to override this so that just the graph wished to be closed is disposed and the application keeps running. I've tried overriding it but there is no response. I'm just a bit puzzled thats all.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Maybe you are using ApplicationFrame (as in the demos) rather than ChartFrame? The best idea is just to create a ChartPanel and embed that in your own JFrames...
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

