Please use JAVA to solve this, thanks in advanced. Will rate best answer as soon
ID: 638652 • Letter: P
Question
Please use JAVA to solve this, thanks in advanced. Will rate best answer as soon as I verify it works exactly as shown in the Example Dialog. Please comment if you need more information or have a question.
Objective:
Write a program in which the user can:
Read a video game collection file. The file is assumed to have the name and the console and its tab delimited. It is advisable to put each of the games in an ArrayList since number of games is not known.
Search the contents of the file that has already been loaded in from part 1. The user enters the name of the game and then the name of the console.
Matches for the game and console entered are returned
Partial matches for the name or console are acceptable
This is not case sensitive
User may use the character
Explanation / Answer
Hope this will helps you in some basic implemnentation
It can be used as a reference
public class MainMidlet extends MIDlet implements CommandListener {
private SSGameCanvas gameCanvas ;
private Command exitCommand ;
public void startApp() {
try {
//create new game thread
gameCanvas = new SSGameCanvas();
gameCanvas.start(); // start game thread
exitCommand = new Command("Exit",Command.EXIT,1);
gameCanvas.addCommand(exitCommand);
gameCanvas.setCommandListener(this);
Display.getDisplay(this).setCurrent(gameCanvas);
}
catch (java.io.IOException e) { e.printStackTrace();}
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command command, Displayable displayable) {
if (command == exitCommand) {
destroyApp(true);
notifyDestroyed();
}
}
}