* J2ME? - MIDP 2.0
* 1 single class + midlet to test it with
* Confirm alert - modal, no timeout.
I want a class that displays an alert and returns the user's choice back to the calling code.
**Example usage:
**
? ConfirmAlert confAlert = new ConfirmAlert("Title","text","OKcommandText","cancelCommandText");
String result =? [login to view URL]();
if(result == "OKcommandText"){
? ? deleteData();
}?
**Note:
**
I do understand how to implement CommandListener interface with CommandAction(command c, displayable d).
However, what I want is a custom class that handles the alert and user's response. I imagine that the custom class might wrap or inherit from Alert and also implement CommandListener.
What I am asking for is to have this functionality encapsulated.
Here is a link to some code that is similar to what I want. However, I don't think this code works:
[login to view URL]
If you read this code you might understand what I am trying to do!
Thank you :)
## Deliverables
In languages such as C# or VB.NET you can call a class "MessageBox". The objective of this project is to create a class that offers the same kind of functionality - Modal display with a return value. In the above "Example usage" the "confirmAlert" class is the class I want you to build in MIDP 2.0. The line of code calling the "show()" method of the confirmAlert class would show an Alert (J2ME alert). This alert will have 2 commands (OK and Cancel) each with configurable labels. (ie. OK might be set to "yes" and Cancel might be set to "No"). Execution of the calling code does not proceed past the past the line containing the "show" method until the user has responded to the alert by choosing either the OK command or the Cancel command. Please ask questions if anything is unclear or if you would like to demonstrate how well you understand the requirements.