From: Ravikiran <rav...@ya...> - 2005-03-26 13:17:53
|
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! |