/** Wall - Unit 1- Intro to Java Programming with Applets / Fall 2015
 * @author Larry Wrolstad 
 * @version Project due date 9/25/15 CSci 1130-51 
 * MY URL http
 */
import java.awt.*;
import javax.swing.*;
import java.applet.*; //required for audio
import java.awt.event.*;
public class Wall extends JApplet implements ActionListener
{
    AudioClip s1;                       //defining audio for buttons
    JButton yodleButton;
    JPanel butpanel;
    JLabel title;
    JTextField fullName;
    
    
    public void init( )
{
    setLayout( new FlowLayout( ) );
    title = new JLabel( "How many bricks to cover the shack? (Choose from 1 to 20)" );
    fullName = new JTextField( 2 );
    add( title );
    add( fullName );
    
}
  
   /** {       
        setLayout( new BorderLayout( ) );
        setupSounds( );
        setupButtons( );                                //Image selects for buttons
    
}
    public void setupSounds( )
    {    
        s1 = getAudioClip( getCodeBase( ), "Yodeling-Bavarianl.wav" );         //Audio selects for buttons
    }*/
    public void setupButtons( )
    {
    yodleButton = new JButton( "Music" );          //Button label
    yodleButton.addActionListener( this );
    
    butpanel=new JPanel( new GridLayout( 3, 1 ) );  //Button position
    butpanel.add( yodleButton );
    add( butpanel, BorderLayout.SOUTH );
}    

    public void actionPerformed( ActionEvent ae)
{
  
    Object src = ae.getSource( );       //Action statements for buttons audio
    if ( src == yodleButton )
    s1.play( );
       
}//new for adding sound


    public void setupButton( JButton btn )
{
    btn.addActionListener( this );
    add( btn );
}

    public void paint( Graphics g )
{
    super.paint( g );                                      
    Image img = getImage( getCodeBase( ), "01.jpg" );
    g.drawImage( img, 48, 40,  this ); 
}  
}

                
        
            
                       