• Post Reply Bookmark Topic Watch Topic
  • New Topic

Applets and sound  RSS feed

Juan Carlos Marin
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do an applet for pedagogical purposes that when the mouse is in on them coloured area it will play a WAV file that incledes, for example the vowels.
However, my know-how of the language has not been enough to compile and run it. Thanks in advance for the advice and help.
This is the code that I have tried to implement.
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet.*;
import java.applet.AudioClip.*;
public class TheVowels extends javax.swing.JApplet implements ActionListener{
AudioClip = vowels;
public void initial(){

setBackground(new Color(128, 255, 255));

vowels=getAudioClip(getCodeBase, "vowels.wav")

addMouseListener(new MouseAdapter(){
public void MouseEntered(MouseEvent e){
public void mouseExited(MouseEvent e){

public void paint(Graphics g){
g.drawString("Move your mouse over this area " 80, 100);
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!