Can I add a Swing Component JButton to the XYSeries chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ashutosh
Posts: 15
Joined: Fri Dec 08, 2006 1:43 pm

Can I add a Swing Component JButton to the XYSeries chart

Post by ashutosh » Tue Dec 12, 2006 8:06 am

Hi,
Can anybody tell me, is it possible to add a Swing button to the XYSeries Chart or DefaultCategoryDataset ChartPanel. If yes then how????

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Can I add a Swing Component JButton to the XYSeries cha

Post by david.gilbert » Tue Dec 12, 2006 4:55 pm

ashutosh wrote:Can anybody tell me, is it possible to add a Swing button to the XYSeries Chart or DefaultCategoryDataset ChartPanel. If yes then how????
You are mixing up a lot of classes there, without (I think) understanding what is really going on. In general, no, you can't add a JButton to a chart. But the ChartPanel class is derived from Swing's JPanel, so you can arrange buttons and charts in the same user interface using a layout manager. Perhaps that is what you mean?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked