Embeded Flash in Java Desktop App

Most of examples about playing Flash animation on desktop application I found on the internet to are done by VB. But today I found java version. Flash SWT Plugin[ many thanks to Don Park ], it work very well on my latest project :).

To use Flash SWT Plugin, download com.docuverse.swt.flash-0.4.zip and extract it somewhere on local disk. Now our eclipse flash project need to add atleast two external jars e.g. flash.jar[from where we just extract the zip] and swt.jar and now we are ready to code.

To play swf file, all we need is FlashPlayer object and activate it that all. it'll look like this.

import com.docuverse.swt.flash.FlashPlayer;

public class SWTPlayer {
private void run() {
// TODO Auto-generated method stub
Display display = new Display();
Shell shell = new Shell(display);
FlashPlayer player = new FlashPlayer(shell);
player.loadMovie(0, "yourflashfile.swf");
player.setSize(550, 400);
shell.setSize(550, 400);
while (!shell.isDisposed()) {
if (!display.readAndDispatch())

here is what it look like when running.

Note : SWT Flash only support on Windows.


Unknown said...

This blog is really interesting, actually i must to say i prefer flash because is a fast program and easy to use. I don´t like the complex program. I just looking for one that be eficient all the time and flash it is. that is why i prefer to buy viagra because i always have a great result in my sexual life.