11package javajs .async ;
22
33import java .awt .Component ;
4- import java .awt .Container ;
54import java .awt .event .ActionEvent ;
65import java .awt .event .ActionListener ;
76import java .beans .PropertyChangeEvent ;
@@ -67,6 +66,19 @@ public AsyncDialog() {
6766
6867 // These options can be supplemented as desired.
6968
69+
70+ /**
71+ * Synchronous call; OK in JavaScript as long as we are using a JavaScript prompt() call
72+ *
73+ * @param frame
74+ * @param msg
75+ * @return
76+ */
77+ @ Deprecated
78+ public static String showInputDialog (Component frame , String msg ) {
79+ return JOptionPane .showInputDialog (frame , msg );
80+ }
81+
7082 public void showInputDialog (Component frame , Object message , ActionListener a ) {
7183 setListener (a );
7284 process (JOptionPane .showInputDialog (frame , message ));
@@ -151,7 +163,7 @@ public static void showYesNoAsync(Component parent, Object message, String title
151163 * @param title TODO
152164 * @param yes
153165 */
154- public static void showYesAsync (Container parent , Object message , String title , Runnable yes ) {
166+ public static void showYesAsync (Component parent , Object message , String title , Runnable yes ) {
155167 AsyncDialog .showYesNoAsync (parent , message , title , new ActionListener () {
156168
157169 @ Override
@@ -171,7 +183,7 @@ public void actionPerformed(ActionEvent e) {
171183 * @param title
172184 * @param ok
173185 */
174- public static void showOKAsync (Container parent , Object message , String title , Runnable ok ) {
186+ public static void showOKAsync (Component parent , Object message , String title , Runnable ok ) {
175187 new AsyncDialog ().showConfirmDialog (parent , message , title , JOptionPane .OK_CANCEL_OPTION , new ActionListener () {
176188
177189 @ Override
@@ -187,7 +199,9 @@ public void actionPerformed(ActionEvent e) {
187199
188200 private void setListener (ActionListener a ) {
189201 actionListener = a ;
190- /** @j2sNative javax.swing.JOptionPane.listener = this */
202+ @ SuppressWarnings ("unused" )
203+ Class c = JOptionPane .class ; // loads the class
204+ /** @j2sNative c.$clazz$.listener = this */
191205 }
192206
193207 private void unsetListener () {
0 commit comments