I have successfully used this in the past from Fortran, you'll have to grep
for JAPI in this code for the appropriate modules:
http://users.tpg.com.au/davidd02/sib-pair.f95.gz
which is compiled with -DJAPI ... -ljapi
A script testing Sib-pair's use of JAPI starts
eval (j_start) \
(define frame (j_frame "Dialog Demo")) \
(define menubar (j_menubar frame)) \
(define fil (j_menu menubar "File")) \
(define qui (j_menuitem fil "quit")) \
(define doi (j_menu menubar "Do It")) \
(define ope (j_menuitem doi "Open Dialog")) \
(define dialog (j_dialog frame "Say Hello!")) \
(define label (j_label dialog "Hello World")) \
(define clo (j_button dialog "Close")) \
(j_setflowlayout dialog 1) \
(j_pack dialog) \
(j_show frame)
eval (j_quit)
See
https://genepi.qimr.edu.au/Staff/davidD/Sib-pair/Documents/Using_Sib-pair/Commands/eval.html
for the list of JAPI functions that are called.
Cheers, David Duffy