I was just wondering if it were possible to link a sound to an option selected in a scanner class in java? For example:
import java.util.*;
public class GameTest
{
public static void main(String[] args)
{
Game myGame = new Game();
Scanner myScanner = new Scanner(System.in);
int size = 30;
boolean done = false;
do
{
System.out.println("1. Add Person");
System.out.println("2. Show Board");
System.out.println("3. Show Next Generation");
System.out.println("4. Clear Board");
System.out.println("5. Exit");
String answer = myScanner.nextLine();
int option = Integer.parseInt(answer);
if (option==1)
{
Blah, blah, blah
}
if I select option #1 can I link a path to a sound on my C:????
I know I prob need to import something, and extend something.
Thanks,
James