PROBLEM WITH APPLET

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
José Luis Guzmán

PROBLEM WITH APPLET

Post by José Luis Guzmán » Thu Dec 06, 2001 5:23 pm

Hello.

I have a problem with my applet using JFreeChart.

When I show my applet with appletviewer, it's ok. But if I
show my applet in browser the message "Applet prueba class prueba
got a security violation: method verificatin error". Why?

My source code is:

public class prueba extends Applet{

Number[][] data = new Integer[][]
{
{ new Integer(12274123) , new Integer(14234225),
new Integer(13223545) , new Integer(15976234) },
{
new Integer(25126782) , new Integer(27456237),
new Integer(22124345) , new Integer(19874235) },
{
new Integer(31234554) , new Integer(28523123),
new Integer(35736012) , new Integer(32123753) }
};



CategoryDataSource myDataSource = new DefaultCategoryDataSource(data);
JFreeChart mychart = JFreeChart.createVerticalBarChart(myDataSource);

JFreeChartPanel myChartPanel = new JFreeChartPanel(mychart);
Title titulo = mychart.getTitle();

Plot myplot = mychart.getPlot();
Axis myHorizontalAxis = myplot.getAxis(Plot.HORIZONTAL_AXIS);
Axis myVerticalAxis = myplot.getAxis(Plot.VERTICAL_AXIS);

DefaultCategoryDataSource d = (DefaultCategoryDataSource) myDataSource;

String[] names = new String[]{"Region 1","Region 2","Region 3"};

String[] categories = new String[]{"Quarter 1","Quarter 2","Quarter 3","Quarter 4"};

public void establecer_caracteristicas()
{
myHorizontalAxis.setLabel("Eje X");
myVerticalAxis.setLabel("Eje Y");
d.setSeriesNames(names);
d.setCategories(categories);
mychart.setTitle("Prueba");
}

public void init()
{
this.establecer_caracteristicas();
add(myChartPanel);
}

}

David Gilbert

RE: PROBLEM WITH APPLET

Post by David Gilbert » Fri Dec 07, 2001 9:55 am

Are you using the Java plugin or a browser that supports JDK 1.2 or later? JFreeChart won't run on JDK1.1 because it needs the Java2D API.

Regards,

DG.

Locked