MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

JLink and speeding up graphics display by java routine

  • To: mathgroup at
  • Subject: [mg36661] JLink and speeding up graphics display by java routine
  • From: Blimbaum Jerry DLPC <BlimbaumJE at>
  • Date: Wed, 18 Sep 2002 02:09:40 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

I am trying to write an animation using JLink.....basically as
follows...(using Mathematica 4.1, JLink 2.01 and java 1.4.1)...

frm = createWindow[];     (* basically to create a MathFrame and a  drawArea
= MathCanvas *)

Here is my drawing routine....

 Map[(obj = drawMembrane[#];
     	Pause[.0001];) &, t ]

t = time list ={0,.25,etc}.... and drawMembrane is a function that uses the
time value to make a graphics plot......unfortunately, this routine draws
the next time plot very slowly, plus I also notice that without the Pause[]
statement, Mathematica only draws the graph for the final time value...

Following an example in the JLink documentation, I have written the
following java routine....which I saved in the same dir as MathFrame,

public class My_DisplayGraphicsViaJava {
    public void displayGraphics(String cmds[]) {  // declare String Array
for Graphics Objects 
          for (int i = 0; i < cmds.length-1; i++) 
                      Thread.sleep(200);}         }

and then in Mathematica I have

My_DisplayGraphicsViaJava`displayGraphics["obj"];    (* where obj is the
array of Graphics plots created *)

But needless to say this dont work....LoadJavaClass responds by saying Class
not what should I do to correct this?   Also , on the java
routine, was i supposed to add:     Extends    MathFrame, will my
java routine know what drawArea.setMathCommand is, I also
supposed to compile my java routine?    

thanks....jerry blimbaum  NSWC panama city, fl

  • Prev by Date: Re: Checking Programming errors; a ?
  • Next by Date: Thanks to all; here's what looks to be best solution
  • Previous by thread: Plotting one point at a time with JLink
  • Next by thread: Re: JLink and speeding up graphics display by java routine