/* * Test2.java * * Created on 2006年8月21日, 上午11:57 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package myTest;/** * * @author lbf */ import java.awt.*; import javax.swing.*; import java.awt.event.*; import jflashplayer.*; import jiebrowser.*; import java.io.*; public class Test2 extends JFrame{
/** Creates a new instance of Test2 */ public Test2() { super("test"); try{ final FlashPanel fp=new FlashPanel(new File("demo.swf")); this.getContentPane().add(fp,BorderLayout.CENTER); } catch(Exception exe){ exe.printStackTrace(); } this.setBounds(300,300,400,400); this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String args[]){ new Test2(); } }首先你要下载了这个包才可以用 其实用起来很方便的
给你一个最简单的方法吧如果你就是想显式的话用swt的类IE控件,然后让他加载那个flash。
最好是不要用它来写,因为它不是标准包
如果你用的话,那么你写的程序就不具有可移植性了
因为没有装SWT的人将运行不了你的程序
!
用了swt的代码当然可以移植。
是什么意思啊?
不错,相当好用,它是一个继承自Panel的类,可以直接加到Frame或者JFrame上面
建议楼主去下载一个用用
* Test2.java
*
* Created on 2006年8月21日, 上午11:57
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/package myTest;/**
*
* @author lbf
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import jflashplayer.*;
import jiebrowser.*;
import java.io.*;
public class Test2 extends JFrame{
/** Creates a new instance of Test2 */
public Test2() {
super("test");
try{
final FlashPanel fp=new FlashPanel(new File("demo.swf"));
this.getContentPane().add(fp,BorderLayout.CENTER);
} catch(Exception exe){
exe.printStackTrace();
}
this.setBounds(300,300,400,400);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String args[]){
new Test2();
}
}首先你要下载了这个包才可以用
其实用起来很方便的