hi.. i want to add two button.. and chose one of them chart with by button...
package chart_exapmles; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import javax.swing.JFrame; import javax.swing.JPanel; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.data.category.CategoryDataset; public class single_chart extends JFrame { String bspr_mem =""; String bspr_cpu =""; String rtx_mem=""; String rtx_cpu =""; public single_chart() { super("baslık"); final JPanel girispanel_kuzey = new JPanel(new GridLayout(2,2,1,1)); //final JPanel girispanel_guney = new JPanel(new GridLayout(1,2,1,1)); //JPanel dugmepanel = new JPanel(new FlowLayout(FlowLayout.LEFT,2,2)); double_list dd= new double_list(); setBackground(Color.red); setForeground(Color.red); add(girispanel_kuzey); setSize(java.awt.Toolkit.getDefaultToolkit().getSc reenSize()); /////////////////////////////////////////1.chart/////////////////////////////////////////// CategoryDataset dataset_bspr_cpu =dd.createDataset_bspr(); JFreeChart chart_bspr_cpu = dd.createChart(dataset_bspr_cpu,"lhssunp00 cpu"); ChartPanel chartPanel_bspr_cpu = new ChartPanel(chart_bspr_cpu); chartPanel_bspr_cpu.setPreferredSize(new java.awt.Dimension(1400,700)); ////////////////////2. chart ////////////////////////////////////////////////////////////////////// CategoryDataset bspr_memory =dd.createDataset_bspr_memory(); JFreeChart chart_bspr_memory = dd.createChart(bspr_memory,"lhssunp00 memory"); ChartPanel chartPanel_bspr_memory = new ChartPanel(chart_bspr_memory); chartPanel_bspr_memory.setPreferredSize(new java.awt.Dimension(1400,700)); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// girispanel_kuzey.add(chartPanel_bspr_cpu); girispanel_kuzey.add(chartPanel_bspr_memory); setLocationRelativeTo(null); setEnabled(true); } }