Menu

SJNI / News: Recent posts

Introduction

The aim of the project is to minimize hassle necessary to get going with JNI. The sample SJNI-based code below:

void test() {
sjniEnv e;
sjniPkg p = e.pkg("javax/swing");
sjniCls JFrame = p.cls("JFrame");
sjniObj frame = JFrame.nnew("()V");
(frame << "setSize" << 300 << 200).callV();
(frame << "setTitle" << e.str("SJNI Test").callV();
int EXIT_ON_CLOSE = JFrame.sfld("EXIT_ON_CLOSE", "I");
(frame << "setDefaultCloseOperation" << EXIT_ON_CLOSE).callV();
(frame << "setVisible" << (jboolean) true).callV();
while (1) { sleep(1); }
}... read more

Posted by sadaszewski 2010-03-12