How to setSize of FlashPanel of jflashplayer ?

Hi!

I download a JFlashplayer to paly swf file. It works well. I want to add FlashPanel in one corner of JFrame as I also have some other control on a JFrame.

For that I tried to setSize of FlashPanel Object by writting:

FlashPanel fp=new FlashPanel();

fp.setSize(100,100);

It shows a small size but you can see only a portion of movie.

How can I shrink the size of flashpanel, so it can play in one corner of JFrame.

I appreciate your any suggestions on this topic.

Thanks

Kirti

[548 byte] By [Kirti_Mistrya] at [2007-10-3 8:53:06]
# 1

Swing related questions should be posted in the Swing forum.

You use setPreferrredSize() to suggest a size of a component. The LayoutManager you are using will then position the component appropriately.

Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Mangers[/url]. You can imbed panels with different layout managers to get your desired layout.

camickra at 2007-7-15 4:02:53 > top of Java-index,Java Essentials,Java Programming...
# 2
Didn't you just say it is only 100 pixels and thus you can't see its contents? So it is shrunk... ?
CeciNEstPasUnProgrammeura at 2007-7-15 4:02:53 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi!

Thank you for your all help. I tried to add FlashPanel object into JPanel by setting it to BorderLayout. After that I add that JPanel to JFrame then It didn't see movie in main Windoe (JFrame).

If I add FlashPanel Object directly to JFrame then It shows movie

I tried by writting

protected FlashPanel fp;

protected JPanel myPanel;

....

fp = new FlashPanel (new File ("."));

myPanel=new JPanel();

// Add component to application抯 myPanel window.

myPanel.add(fp);

// Add myPanel to Main Window.

getContentPane ().add (myPanel);

This coding not dispaly a movie , but movie is still palying I can listion a voice

If I do by this way then it dispaly a movie. I'm able to watch movie

fp = new FlashPanel (new File ("."));

myPanel=new JPanel();

// Add component to application抯 Main window.

getContentPane ().add (fp);

I also tried for other component to add FlashPanel Object in it , but it want see the movie. It works only if I add FlashPanel Object directly to getContenPane().

what to do if I want to add FlashPanel in other Component & after that add it to main Window(JFrame).

I would appreciate your valuable suggestions.

Kirti

Kirti_Mistrya at 2007-7-15 4:02:53 > top of Java-index,Java Essentials,Java Programming...