浏览器没装JRE插件,不需Tomcat应该也能运行才对。
解决方案 »
- 熟悉ireport布局的 帮忙看下
- JSP 急!!!!啊!!!!!数据源
- 一条查询语句满足两种条件的列表如何实现的?
- 在Jsp中怎么做可以使得页面在不刷新的情况下做到把页面数据提交到后台
- 大家帮忙看看table问题?
- JSP与存储过程
- 请问这种用静态方法返回一个数据库的连接,是否这种方法将降低数据库连接的效率呢。
- 在一个servlet中,如何只向数据库提交一次,就同时执行多个SQL语句
- jsp如何与ms sql server连接?
- 我是jsp菜鸟,我的nt下装了iis4和APACHE,我刚装了JDK1.2,可我不知道在哪里配置,怎么启动,程序在那个目录下写
- 我想要将“\”转换成别的字符,怎么做?
- 求关于标签库的基本概念和设计过程的资料
public class PinjuanApplet extends Applet implements
ControllerListener
{
private boolean isStandalone = false;
Player player;
Component visualcom, controlcom;
boolean playType;
String currentDirectory;
JPanel jPanelVideo = new JPanel();
JPanel jPanelCont=new JPanel();
BorderLayout borderLayout2 = new BorderLayout();
BorderLayout borderLayout1 = new BorderLayout();
JButton jb=new JButton("播放");
int record=0;
public PinjuanApplet() {
}
public void init() {
try { jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(borderLayout1);
this.setSize(new Dimension(400, 300));
this.setVisible(true);
this.setBackground(new Color(0,0,0));
playType=false;
jPanelVideo.setToolTipText("视频窗口");
jPanelVideo.setVerifyInputWhenFocusTarget(true);
jPanelVideo.setLayout(borderLayout2);
jb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jbAction(e);
}}
);
jb1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jb1Action(e);
}}
);
jb.setSize(200,30);
jPanelCont.add(jb);
this.add(jPanelVideo, BorderLayout.CENTER);
this.add(jPanelCont,BorderLayout.SOUTH);
}
public void jbAction(ActionEvent e)
{
playType=true;
record=0;
boFangControl();
}
public void boFangControl() {
int kid;
Vector mtype=new Vector();
Vector mcontent=new Vector();
mtype.add(new Integer(1));
mtype.add(new Integer(5));
mtype.add(new Integer(1));
if(record>=mtype.size()) return;
int flag = ( (Integer) mtype.elementAt(record)).intValue();
if (flag == 1) {
//showText((String) mcontent.elementAt(record));
showText("意思xxxxx");
}
if (flag == 4 || flag == 5) {
showMedia();
}
}
public void showText(String show)
{
record++;
repaint();
TextArea tarea=new TextArea(show,5,20);
jPanelVideo.add(tarea, BorderLayout.CENTER );
jPanelVideo.show();
this.add(jPanelVideo, BorderLayout.CENTER);
repaint();
try{
Thread.sleep(30000);
}catch(Exception ex){}
jPanelVideo.remove(tarea);
boFangControl();
}
public void showMedia()
{
record++;
String s2="1.mpg";
if (player != null)
player.close();
try {
player = Manager.createPlayer(new MediaLocator
("file:/"+"d:/"+s2));
}
catch (java.io.IOException e2) {
System.out.println(e2);
return;
}
catch (NoPlayerException e2) {
System.out.println("不能找到播放器.");
return;
}
if (player == null) {
System.out.println("无法创建播放器.");
return;
}
player.addControllerListener ( this );
player.prefetch(); }
public void controllerUpdate (ControllerEvent e)
{
// 调用player.close()时ControllerClosedEvent事件出现。
// 如果存在视觉部件,则该部件应该拆除(为一致起见,
// 我们对控制面板部件也执行同样的操作)
if (e instanceof ControllerClosedEvent) {
if (visualcom != null) {
jPanelVideo.remove(visualcom);
visualcom = null;
}
if (controlcom != null) {
jPanelVideo.remove(controlcom);
controlcom = null;
}
return;
}
if (e instanceof EndOfMediaEvent) {
if(player!=null)
player.close();
if (visualcom != null) {
jPanelVideo.remove(visualcom);
visualcom = null;
}
if (controlcom != null) {
jPanelVideo.remove(controlcom);
controlcom = null;
}
//this.remove(jPanelVideo);
boFangControl();
return;
}
if (e instanceof PrefetchCompleteEvent) {
player.start();
return;
}
if (e instanceof RealizeCompleteEvent) {
visualcom = player.getVisualComponent();
if (visualcom != null)
jPanelVideo.add(visualcom, BorderLayout.CENTER );
controlcom = player.getControlPanelComponent();
if (controlcom != null)
jPanelVideo.add(controlcom, BorderLayout.SOUTH );
//this.add(jPanelVideo,BorderLayout.CENTER);
repaint();
}
}}