Thanks for your message, we'll be more precise on that point in the next release of OxJapi and, as I've been asked several times about it, here are possible solutions.
To get the RanApp example work without the message
'Cannot show draw window!'
you need to run it with GiveWin (it's basically the same with J.A Doornik's RanApp described in the Ox Appendices).
Otherwise, if you don't have GiveWin on your machine, you can save the graphs in EPS format and view them afterwards.
So, instead of the OnDraw function, you can slightly modify the main function with:
if (jObj == jButtonDraw)
{
DrawCorrelogram(0, mX[][0]', "ran1", iAcf);
DrawSpectrum(1, mX[][0]', "ran1", iAcf);
SaveDrawWindow(sprint("graph_iT", iT, "_iN", iN, ".eps"));
}
Note that files with the same name will be overwritten.
You can even use a dialog box (the j_filedialog function) to select the name of the file to be saved:
decl sFilename = new string[512];; // before the do-while loop
if (jObj == jButtonDraw)
{
DrawCorrelogram(0, mX[][0]', "ran1", iAcf);
DrawSpectrum(1, mX[][0]', "ran1", iAcf);
sprint(sFilename, j_filedialog(jFrame, "Save File", ".", sFilename));
SaveDrawWindow(sFilename);
}
and you may change the label of the Draw button:
decl jButtonDraw = j_button(jPanel, "Save...");
It must also be possible (but I haven't tried yet) to combine OxJapi with Charles Bos' GnuDraw package.
Well, I hope this helps.
By the way, all the examples in the directory samples/japi don't depend on GiveWin.
Christine Choirat
Email: [log in to unmask]
Homepage: http://site.voila.fr/choirat/index.html
> Congratulation for this great mariage.
>
> I've just tested the examples in the "samples" directory
> and all worked fine except to get the window "draw"
> (in the examples RanApp.ox and others RanAppxxx.ox),
> I got systematically the following error message:
> "Cannot show draw window!".
>
> Platform: Windows 98,
> For Java: J2SDK1.4
>
> Any clues ?
> Thanks in advance
>
> ps: idée géniale, félicitation ! (I think you speak french...)
> --
> Fan
------------------------------------------
Faites un voeu et puis Voila ! www.voila.fr
|