• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Applets and sound

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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){
play(getCodeBase."vowel.wav");
}
public void mouseExited(MouseEvent e){
stop();
}
});

public void paint(Graphics g){
g.drawString("Move your mouse over this area " 80, 100);
}
}
 
We can walk to school together. And we can both read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic