Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Ivor Horton's Beginning Java, Java 7 Edition
|
BOOK: Ivor Horton's Beginning Java, Java 7 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java, Java 7 Edition by Ivor Horton ; ISBN: 978-0-470-40414-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Java, Java 7 Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 21st, 2012, 06:21 AM
Authorized User
 
Join Date: Mar 2012
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Applet for .avi file via Application Program

Hello Colleages and authors
Please help me to correct the following program in jav whose output message is also indicated as shown in the comments line at the end of the prgra
<code>

import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import javax.swing.JOptionPane;
import java.awt.Graphics;
import java.net.URL;
import java.applet.AudioClip;





/*
<APPLET code ="AudioPlayerApplet.class"
CODEBASE =AudioPlayerApplet.class,Uzhaipu1.avi
ARCHIVES="class1.jar, extras/class2.jar"
height=400 width=400>
</APPLET>.
*/

public class AudioPlayerApplet extends Applet {
Button start ,stop;
URL codebase;
AudioClip song;
AudioClip bgVideo;



public void init()
{




song=getAudioClip(getCodeBase(),"loop.avi");
bgVideo=getAudioClip(getCodeBase(), "class1.jar,extras/class2.jar");


start = new Button("Start");
stop = new Button("Stop");
codebase=getCodeBase();
add(start);
add(stop);
start.addActionListener(new ButtonHandler());
add(start);
stop.addActionListener(new ButtonHandler());
add(stop);




}
class ButtonHandler implements ActionListener {

public void actionPerformed(ActionEvent ae )
{


if (ae.getSource() == start)

{
System.out.println("AudioPlayerApplet.class" + bgVideo);
setVisible(true);
show();

}
else
if(ae.getSource() == stop)
{
return ;
}
}

public void paint(Graphics g)
{
g.drawString ("AudioPlayerApplet.class",60,100);
}
}

}

</code>
The jars are made asper BeginningJava 2 ,1.3 edition
Hope the authors may help.
As
muthukutta1





Similar Threads
Thread Thread Starter Forum Replies Last Post
which DirectShow method helps to find out if video is not running of an .avi file.? mbatra Visual C++ 0 April 9th, 2012 02:14 AM
How to retrieve codec name of an .avi file using VC++/mfc programming. mbatra Visual C++ 0 April 3rd, 2012 05:48 AM
can an applet read from a file starsailor Pro JSP 1 January 7th, 2005 12:58 PM
need help of tab control & AVI file in a form mohiddin52 Access 2 December 4th, 2004 11:01 AM
Trouble Converting Application to applet suzieque Java GUI 2 August 19th, 2003 01:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.