LiveForm[graphics_, animOpts___] := 
        Module[{graphics3d = 
              Switch[graphics, _ContourGraphics, 
                Graphics3D[SurfaceGraphics[graphics]], _DensityGraphics, 
                Graphics3D[SurfaceGraphics[graphics]], _SurfaceGraphics, 
                Graphics3D[graphics], _, graphics]}, 
          Switch[graphics3d, _List, HoldForm[ShowAnimation][
              NumberForm[InputForm[N[graphics3d]], 5], 
              InputForm[N[Flatten[{animOpts}]]]], _, 
            NumberForm[InputForm[N[graphics3d]], 5]]];

WriteLiveForm[filename_, graphics_, animOpts___] := 
        Module[{ps, x}, ps = Unprotect[Real]; 
          Format[x_Real, InputForm] := 
            OutputForm[
              NumberForm[x, 5, 
                NumberFormat -> (If[#3 == "", #1, 
                        SequenceForm[#1, "*^", #3]] &)]]; 
          Protect @@ ps; 
WriteString[filename, 
            ToString[LiveForm[graphics, animOpts], 
              CharacterEncoding -> None]]; 
          Close[filename]; 
ps = Unprotect[Real]; 
          Format[x_Real, InputForm] =. ; Protect @@ ps;];

g = Plot3D[Sin[x y], {x, -2, 2}, {y, -2, 2}]

g = Graphics3D[pst3DPl];

Show[g]

<< JLink`

InstallJava[]

AddToClassPath["/home/soukup/tool/math/wm"]

liveApplet = JavaNew["Live"]

liveFrame = 
        JavaNew["com.wolfram.jlink.MathAppletFrame", 
          liveApplet, {"INPUT=" <> 
              ToString[
                InputForm[
                  N[g]]], "WIDTH=400", "HEIGHT=400"}];

With[{filename = "sintst.m"}, 
        WriteString[filename, 
          ToString[InputForm[N[g]], CharacterEncoding -> None]]; 
        Close[filename]];