Skip to main content

Flashplayer demo problem (JDICPlus)

2 replies [Last post]
Joined: 2007-12-04


I need to show a flash file in Windows, then I begun a work with the FlashPlayer demo, but I have a problem, the animation only starts if I do a clik in the panel, without the clik, I ear the sound but I cannot see the animation, I see that the animation don't refresh....

I try setting the focus to the flash panel but don't work, sending a artificial click mouse event but don't work....

Can you give me some hint ???


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-01-10

In some versions of Flash player it can create child window instead of rendering over original IE context. That is a problem now, but I hope to fix it soon by cascade windows subclassing.

Thank for your interest!

Joined: 2008-08-31

Hi ,

i'm trying to play flash file in jframe using JDIC web browser .

i'm able to panel to play in a panel in a frame .

my requirement is :

1 ) i want to play multiple flash files in a single frame in different panels .

i have taken two WebBrowser instances and

setURL(new URL("file:///F:/Java/SMProject/SWFs/mammyblue2.swf"));

and added two browser instances in two panels .

it is not working for more isntances .

2) i have some background image for the jframe .

i want to play flash file small portion of the frame with background .

but what is happening is , this web browser shifting the background image aside and then palying the flash file .

here is the code i'm doing .

public class SimpleBrowser extends JFrame {

JScrollPane scrollPane;
ImageIcon icon;
Image image;

public SimpleBrowser()
icon = new ImageIcon("myjpeg.jpg");

JPanel panel = new JPanel()
protected void paintComponent(Graphics g)
g.drawImage(icon.getImage(), 0, 0, null);
panel.setOpaque( false );
panel.setPreferredSize( new Dimension(400, 400) );
scrollPane = new JScrollPane( panel );
getContentPane().add( scrollPane );

WebBrowser webBrowser = new WebBrowser();

//Use below code to check the status of the navigation process,
//or register a listener for the notification events.
new WebBrowserListener() {
public void downloadStarted(WebBrowserEvent event) {;}
public void downloadCompleted(WebBrowserEvent event) {;}
public void downloadProgress(WebBrowserEvent event) {;}
public void downloadError(WebBrowserEvent event) {;}
public void documentCompleted(WebBrowserEvent event) {;}
public void titleChange(WebBrowserEvent event) {;}
public void statusTextChange(WebBrowserEvent event) {;}
public void windowClose(WebBrowserEvent arg0) {
// TODO Auto-generated method stub


try {
// webBrowser.setURL(new URL("file:///F:/VEDIOS/flash_fma.swf")); //file:///F:/VEDIOS/flash_fma.swf //
webBrowser.setURL(new URL("file:///F:/Java/SMProject/SWFs/mammyblue2.swf"));

} catch (MalformedURLException e) {

JPanel panel2 = new JPanel();
panel2.setLayout(new BorderLayout());
panel2.setPreferredSize(new Dimension(500, 300));
panel2.add(webBrowser, BorderLayout.CENTER);
getContentPane().add(panel2, BorderLayout.WEST);


public static void main(String[] args) {
// JFrame frame = new JFrame("JDIC API Demo - SimpleBrowser");

JFrame frame = new SimpleBrowser();

// frame.setUndecorated(true);