
package servlets;

import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

public class InitialPage {

	private JLabel lable;
	static FrameClass frame;
	static highScore hiScore;
	static int Height;
	static int Width;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			@SuppressWarnings("static-access")
			public void run() {
				try {
					InitialPage window = new InitialPage();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public InitialPage() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new FrameClass();
		Height = frame.getHeight();
		Width = frame.getWidth();
		frame.getContentPane().setForeground(new Color(0, 0, 205));
		frame.getContentPane().setFont(new Font("Lucida Grande", Font.BOLD, 50));
		frame.getContentPane().setBackground(Color.RED);
		// frame.setBackground(Color.RED);
		frame.getContentPane().setLayout(null);
		frame.setResizable(false);

		JLabel lblNewLabel = new JLabel("VOGEL");
		lblNewLabel.setForeground(Color.BLUE);
		lblNewLabel.setFont(new Font("Comic Sans MS", Font.BOLD, 150));
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setBounds(243, 32, 500, 166);
		frame.getContentPane().add(lblNewLabel);

		JButton btnNewButton = new JButton("PLAY");
		btnNewButton.setForeground(Color.GREEN);
		btnNewButton.addActionListener(new Action());
		btnNewButton.setBackground(Color.LIGHT_GRAY);
		btnNewButton.setFont(new Font("Comic Sans MS", Font.BOLD, 26));
		btnNewButton.setBounds(Width / 2 - 60, Height / 2 - 10, 120, 50);
		frame.getContentPane().add(btnNewButton);
		// High Score
		String HIscore = "";
		try {
			HIscore = highScore.updateHiScore(0).toString();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		lable = new JLabel();
		lable.setFont(new Font("Comic Sans MS", Font.BOLD, 24));
		lable.setText("   Your High Score : " + HIscore);
		lable.setForeground(Color.YELLOW);
		lable.setBounds(Width / 2 - 250, Height / 2 + 155, 380, 50);
		frame.getContentPane().add(lable);
		// lable.setColumns(10);
		// frame.setBounds(100,100,Width,Height);
	}

	static class Action implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {
			// System.out.println("hello");
			try {
				Thread.sleep(500);
			} catch (InterruptedException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			frame.setVisible(false);
			Activity a = new Activity();
			a.ConnectActivity();
		}

	}
}

@@ -178,21 +178,115 @@
 .io.
-IOException;%0A
+File;%0Aimport java.io.IOException;%0A%0Aimport javax.sound.sampled.AudioSystem;%0Aimport javax.sound.sampled.Clip;
 %0Aimp
@@ -458,17 +458,17 @@
 %09static 
-h
+H
 ighScore
@@ -515,16 +515,68 @@
 t Width;
+%0A%09static Boolean playClip = true;%0A%09static Clip clip;
 %0A%0A%09/**%0A%09
@@ -843,16 +843,196 @@
 (true);%0A
+%09%09%09%09clip = AudioSystem.getClip();%0A%09%09%09%09%09clip.open(AudioSystem.getAudioInputStream(new File(%22SoundClips/latinHorn.wav%22)));%0A%09%09%09%09%09clip.loop(clip.LOOP_CONTINUOUSLY);%0A%09%09%09%09%09clip.start();%0A
 %09%09%09%09%7D ca
@@ -1094,16 +1094,17 @@
 %7D%0A%09%09%7D);%0A
+%0A
 %09%7D%0A%0A%09/**
@@ -2369,17 +2369,17 @@
 score = 
-h
+H
 ighScore
@@ -2502,17 +2502,16 @@
 ();%0A%09%09%7D%0A
-%0A
 %09%09lable 
@@ -2778,79 +2778,8 @@
 e);%0A
-%09%09// lable.setColumns(10);%0A%09%09// frame.setBounds(100,100,Width,Height);%0A
 %09%7D%0A%0A
@@ -2894,48 +2894,45 @@
 %0A%09%09%09
-// System.out.println(%22hello%22);%0A%09%09%09try %7B
+try %7B%0A%09%09%09%09clip.close();// close music
 %0A%09%09%09
@@ -2950,16 +2950,37 @@
 ep(500);
+// pause for 900 msec
 %0A%09%09%09%7D ca

Update InitialPage.java