[Migrated content. Thread originally posted on 14 June 2005]
Hello,whe are testing the Acucobol 7 beta, with the interoperability for java whe are interest in that feature, while testing i stop on this problem, i'm trying to make a call on one of our classes that generates a chart graphic, to do that whe are using a graphic engine, i'm making a call to the public static void main, wich work for me on a simple program without the graphic generation, only the java window to see if it does it, and it did. so i tried to make a call the same way but with the graphic generation. the C$JAVA trows me the STATUS-VAL = 93, and i did`nt make it to display the window with the graphic.
this is the call in cobol for the public static void main, name of the class ejemplos.
CALL "C$JAVA" USING CJAVA-CREATEARRAY, CJAVA-STRINGARRAY, 1
GIVING ARRAY-HANDLE.
MOVE "99999999999999999999" TO STRING-TABLE(1)
CALL "C$JAVA" USING CJAVA-SETARRAYELEMENT, ARRAY-HANDLE, 1,
STRING-TABLE(1), GIVING STATUS-VAL.
CALL "C$JAVA" USING CJAVA-CALLSTATIC,"ejemplos", "main",
"([X)V", array-handle
GIVING STATUS-VAL.
below is the java code where it makes several call to other methods inside.
import java.awt.Frame;
import java.awt.Graphics;
import java.util.*;
import java.awt.image.BufferedImage;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Paint;
import java.awt.GradientPaint;
import com.jrefinery.chart.PiePlot;
import com.jrefinery.chart.JFreeChart;
import com.jrefinery.chart.ChartFactory;
.
.
.
.
public class ejemplos extends Frame {
BufferedImage grafica = null;
.
.
.
public ejemplos(){
initComponents();
}
private void initComponents(){
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent evt){
exitForm(evt); }
});
pack();
}
private void exitForm(WindowEvent evt){
System.exit(0);
}
public static void main(String args[]){
ejemplos miventana = new ejemplos();
miventana.setSize(400,400);
miventana.show();
}
public BufferedImage creaImagen()
{
.
.
DoChart();
.
}
//////////////////////////////////////////////////////////////////////////////// private String GetChildItem(Element elemItem, String strElemName)
{
.
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void LoadDataDoc(String strDocURL)
{
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void LoadConfigDoc(String strConfigURL)
{
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void LoadSeries(String strSeries)
{
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void LoadCategories(String strCategories)
{
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void LoadSeriesTitles(String strSeriesTitles)
{
.
.
}
//////////////////////////////////////////////////////////////////////////////////
private void DoChart()
{
.
categoryData = createDataset();
.
.
}
////////////////////////////////////////////////////////////////////////////// //
private void setupChart()
{
.
.
}
////////////////////////////////////////////////////////////////////////////// //
private CategoryDataset createDataset()
{
.
.
}
public void paint(Graphics g){
if (grafica == null)
{
grafica = this.creaImagen();
}
g.drawImage(grafica,10,20,null);
}
////////////////////////////////////////////////////////////////////////////////////////
}