mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-20 17:47:03 -04:00
Preview 6.1
This commit is contained in:
@@ -1,11 +1,39 @@
|
||||
package javax.swing;
|
||||
|
||||
import java.awt.Component;
|
||||
import android.app.*;
|
||||
import android.util.*;
|
||||
import java.awt.*;
|
||||
import java.awt.mod.*;
|
||||
import android.content.*;
|
||||
|
||||
public class JOptionPane
|
||||
{
|
||||
public static void showMessageDialog(Component parentComponent , Object title, String message, int messageType)
|
||||
{
|
||||
|
||||
private static boolean isOk;
|
||||
public static void showMessageDialog(Component parentComponent, final Object title, final String message, int messageType) {
|
||||
Log.w("JOptionPane", "[" + message + "] " + title.toString());
|
||||
|
||||
isOk = false;
|
||||
final Activity act = ModdingKit.getCurrentActivity();
|
||||
act.runOnUiThread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
AlertDialog.Builder dialog = new AlertDialog.Builder(act);
|
||||
dialog.setTitle(title.toString());
|
||||
dialog.setMessage(message);
|
||||
dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
isOk = true;
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
while (!isOk) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user