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
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.
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