hello i think the easiest way is to conver the chart to an image first
then set it as an icon on a button
On Sat, 26 Mar 2005 13:17:40 +0000 (GMT), Ravikiran
<rav...@ya...> wrote:
> hello,
> Plz tell me whats wrong with this code.The chart appears
> momentarily and vanishes.
>
>
> import org.jCharts.chartData.ChartDataException;
> import org.jCharts.chartData.PieChartDataSet;
> import org.jCharts.nonAxisChart.PieChart2D;
> import org.jCharts.properties.*;
> import javax.swing.*;
> import java.awt.event.*;
> import java.awt.*;
>
> public class test
> {
> JFrame frame = new JFrame();
> MenuBar jmb = new MenuBar();
> Menu file = new Menu("FILE");
> MenuItem chart = new MenuItem("chart") ;
> //chart.addActionListener(new actionlistener(){
> // public void actionPerformed(ActionEvent e){
> //SwingDemo s = new SwingDemo(12,34,56);
> //};
> public test()
> {
> file.add(chart);
> jmb.add(file);
> frame.setMenuBar(jmb);
> frame.setSize(new Dimension(200,300));
> frame.setVisible(true);
> chart.addActionListener(new ActionListener(){
> public void actionPerformed(ActionEvent e){
> try{
> SwingDemo s = new SwingDemo(12,34,56);
> }catch(ChartDataException ce){}
> catch(PropertyException pe) {}
> }});
> }
> public static void main(String args[])
> {
> test t = new test();
> }
> }
>
> ________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
>
>
|