To Run Flash file in Java application
807569Sep 27 2006 — edited Sep 27 2006Hi all !!
I am trying to run Flsh file in java application but its throwing RUNTIME EXCEPTION as :
java.io.IOException : create process c:\FlashDemo.swf error=193
- FlashDemo.swf is my flash file to be run
- MyFlash.java is the Java application in c:\MyFlash.java
- FlashTest.bat is the batch file for flash file FlashDemo.java
The contents of FlashTest.bat are :-
SETLOCAL c:\FlashDemo.swf
Here is the source code :-
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
//import java.util.*;
public class MyFlash extends JFrame
{
static int returnFlash;
int i;
public int rundoc() //throws IOException
{
String commandLine = "C:\\ELS\\Applications\\Match.swf";
try
{
Runtime rt = Runtime.getRuntime();
rt.getRuntime();
//Runtime.getRuntime().exec("c:\\ELS\\Applications\\Match.swf");
synchronized(this)
{
//StringTokenizer tkn = new StringTokenizer(commandLine);
Process proc = rt.exec(commandLine);
/*InputStream in = proc.getInputStream();
i=in.read();*/
int exitVal = proc.waitFor();
returnFlash = exitVal;
}
}
catch(Exception e)
{
e.printStackTrace();
}
return returnFlash;
}
public static void main(String arg[]) throws IOException
{
MyFlash ra=new MyFlash();
ra.setVisible(true);
int i = ra.rundoc();
}
}
I would be very thankful if anyone can help me out in the same.
Thanks,
Manasi