Swing panel : chart not working!!!
Ravikiran <[email protected]> Sat, 26 Mar 2005 13:17:40 +0000 (GMT)
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
--0-688216057-1111843060=:28938
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
hello,
Plz tell me whats wrong with this code.The chart appears mom=
entarily and vanishes. =20
=20
=20
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.*;
=20
public class test
{
JFrame frame =3D new JFrame();
MenuBar jmb =3D new MenuBar();
Menu file =3D new Menu("FILE");
MenuItem chart =3D new MenuItem("chart") ;
//chart.addActionListener(new actionlistener(){
// public void actionPerformed(ActionEvent e){
//SwingDemo s =3D 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 =3D new SwingDemo(12,34,56);
}catch(ChartDataException ce){}
catch(PropertyException pe) {}
}});
}
public static void main(String args[])
{
test t =3D new test();
}
}
=09
---------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!=20
--0-688216057-1111843060=:28938
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<DIV>hello,</DIV>
<DIV> &n=
bsp; Plz tell me whats wrong with this code.The chart appears momentarily=
and vanishes. </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>import org.jCharts.chartData.ChartDataException;<BR>import org.jChar=
ts.chartData.PieChartDataSet;<BR>import org.jCharts.nonAxisChart.PieChart=
2D;<BR>import org.jCharts.properties.*;<BR>import javax.swing.*;<BR>impor=
t java.awt.event.*;<BR>import java.awt.*;</DIV>
<DIV> </DIV>
<DIV> public class test<BR> {</DIV>
<DIV> JFrame =
frame =3D new JFrame();<BR> &nbs=
p; MenuBar jmb =3D new MenuBar();<BR> =
Menu file =3D new Menu("FILE");<BR>&=
nbsp; MenuItem char=
t =3D new MenuItem("chart") ;<BR> &nbs=
p; //chart.addActionListener(new actionlistener(){<BR>&=
nbsp; // public void acti=
onPerformed(ActionEvent e){<BR> =
//SwingDemo s =3D new SwingDemo(12,34,56);<BR> &n=
bsp; //};</DIV>
<DIV> public =
test()<BR> {<=
BR> &nbs=
p; file.add(chart);<BR> &n=
bsp; &nb=
sp; jmb.add(file);<BR> &nb=
sp; frame.setMenuBa=
r(jmb);<BR> &n=
bsp; frame.setSize(new Dimension(200,=
300));<BR> &nb=
sp; frame.setVisible(true);<BR> =
&=
nbsp; chart.addActionListener(new
ActionListener(){<BR> &nb=
sp; public void actionPer=
formed(ActionEvent e){<BR>  =
; try{<BR> &nb=
sp; &nbs=
p; SwingDemo s =3D new SwingDemo(12,34,56);<BR> &n=
bsp; &nb=
sp; }catch(ChartDataException ce){}<BR> &nbs=
p;  =
; catch(PropertyException pe) {}<BR> &=
nbsp; &n=
bsp; }});<BR> =
}<BR> =
public static void main(String args[])</DIV>
<DIV> {<BR>&n=
bsp; &nb=
sp; test t =3D new test();<BR> &=
nbsp; }<BR> }</DIV>=
<p>
<hr size=3D1>Do you Yahoo!?<br>=20
Yahoo! Small Business - <a href=3D"http://us.rd.yahoo.com/evt=3D31637/*ht=
tp://smallbusiness.yahoo.com/resources/">Try our new resources site!</a>=20
--0-688216057-1111843060=:28938--
-------------------------------------------------------
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