<p>I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey.</p>

<pre><code>if (YesNoDialog.ask("Are you sure?") == true) {
  // yes was chosen
} else {
  // no was chosen
}
</code></pre>

I dont have programed in Java ME, but i found in it's reference for optional packages the
Advanced Graphics and User Interface API
, and it's used like the Java SE API to create these dialogs with the
JOptionPane Class
```
int JOptionPane.showConfirmDialog(java.awt.Component parentComponent, java.lang.Object >message, java.lang.String title, int optionType)
```
Return could be
```
JOptionPane.YES_OPTION
```
,
```
JOptionPane.NO_OPTION
```
,
```
JOptionPane.CANCEL_OPTION
```
...