FrontEnd and JLink
- To: mathgroup at smc.vnet.net
- Subject: [mg87883] FrontEnd and JLink
- From: labrach at gmail.com
- Date: Sat, 19 Apr 2008 03:35:24 -0400 (EDT)
I want to create Mathematica graphical objects (notebook with cells, palettes, plots, etc) from a Java Gui using JLink calls Apparently, this is not possible until you don't use the Mathematica.exe frontend (no way to initialize a frontend from a java gui) hereafter a Java example Any helps ? laurent ------------------------------------------------------------------------------------ import com.wolfram.jlink.*; class Exemple_FrontEnd { public static void main (String[] args){ try { KernelLink ml = MathLinkFactory.createKernelLink("-linkmode launch - linkname \"MathKernel\""); ml.evaluateToInputForm("Needs[\"" + KernelLink.PACKAGE_CONTEXT + "\"]",0); ml.evaluateToInputForm("ConnectToFrontEnd[]", 0); setVisible(True); ml.evaluate("UseFrontEnd[NotebookCreate[]]"); } catch (MathLinkException e) { e.printStackTrace(); } } }