Re: Swing panel : chart not working!!!
Uder Zonan <[email protected]> Sun, 27 Mar 2005 01:43:48 -0800
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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! > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click