how to display message box in applet

M

Madhur Ahuja

Can javax.swing.JoptionPane.showMessageDialog() be used in a Applet. If not,
what should I use.

--
Winners dont do different things, they do things differently.

Madhur Ahuja
India

Homepage : http://madhur.netfirms.com
Email : madhur<underscore>ahuja<at>yahoo<dot>com
 
M

Madhur Ahuja

Yes, I tried ,but it didn't worked. I used
JOptionPane.showMessageDialog("madhur");

The program executes, successfully, no error message, but the message doesnt
displays.

--
Winners dont do different things, they do things differently.

Madhur Ahuja
India

Homepage : http://madhur.netfirms.com
Email : madhur<underscore>ahuja<at>yahoo<dot>com
 
M

Matt Humphrey

Madhur Ahuja said:
Yes, I tried ,but it didn't worked. I used
JOptionPane.showMessageDialog("madhur");

The program executes, successfully, no error message, but the message doesnt
displays.

I find it hard to believe that the very widely used JOptionPane would simply
do nothing at all. I would think that either Swing is available and it
should work (I just tried it from a 1.1.8 compatible Applet) or you should
get a ClassNotFound exception. Are you sure the dialog was executed? Did
you check the console for messages, as it may have terminated after making
an initial appearance. Are you sure the applet reloaded?

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 
A

Andrew Thompson

I find it hard to believe that the very widely used JOptionPane would simply
do nothing at all.

I agree, are you using IE, Madhur?
...I would think that either Swing is available and it
should work (I just tried it from a 1.1.8 compatible Applet)

Swing was not part of the core classes until 1.2,
it should fail on a 1.1.8 JVM..
..or you should
get a ClassNotFound exception.

If using a pre 1.2 JVM such as the MSVM for instance..
..Are you sure the dialog was executed? Did
you check the console for messages, as it may have terminated after making
an initial appearance.

I suspect that is the case..

Madhur, we need more details..
What browser/version are you using on what OS?
What version of Java is running in it?
<http://www.physci.org/pc/property.jsp?prop=java.version>
Do you know how to find the console in your browser?

Also, I think it might help to put an example
on the net, perfect for an applet..
<http://www.physci.org/codes/sscce.jsp>
 
M

Madhur Ahuja

Sorry, It is working.
Actually the problem was the editor JCreator, it was loading the old copy of
the class file rather than newly compiled.

--
Winners dont do different things, they do things differently.

Madhur Ahuja
India

Homepage : http://madhur.netfirms.com
Email : madhur<underscore>ahuja<at>yahoo<dot>com
 
A

Andrew Thompson

M

Matt Humphrey

Andrew Thompson said:
I agree, are you using IE, Madhur?


Swing was not part of the core classes until 1.2,
it should fail on a 1.1.8 JVM..

I agree. I inserted the call into an Applet that normally runs under 1.1.8
and compiled and ran it with the 1.4.2 plug-in. My point was that either
Swing is available and any use of JOptionPane would work (even from an
Applet--not JApplet), or it's not available and wouldn't work. JOptionPane
has a Component parameter that wasn't shown.

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top