I am trying to use JFreeChart to create charts obviously. JFreeChart come with ChartFrame and ChartPanel.
I have a class to create the chart itself then in another class i have ChartPanel and add that to a normal JPanel this works so far
by using :
my problem is that when i click the button an try to change the chart displaying it won't do anything i can't think it would be about the class that creates the chart it would be the method of displaying.Code:ChartPanel chartsPanels = new ChartPanel(charts);
GroupLayout mainPanelLayout = new GroupLayout(chartPanel);
chartPanel.setLayout(mainPanelLayout);
mainPanelLayout.setAutoCreateContainerGaps(true);
mainPanelLayout.setAutoCreateGaps(true);
GroupLayout.SequentialGroup hGroup = mainPanelLayout.createSequentialGroup();
hGroup.addComponent(chartsPanels);
mainPanelLayout.setHorizontalGroup(hGroup);
GroupLayout.SequentialGroup vGroup = mainPanelLayout.createSequentialGroup();
vGroup.addComponent(chartsPanels);
mainPanelLayout.setVerticalGroup(vGroup);
