how to display message box in applet

Discussion in 'Java' started by Madhur Ahuja, Aug 9, 2004.

  1. Madhur Ahuja

    Madhur Ahuja Guest

    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
     
    Madhur Ahuja, Aug 9, 2004
    #1
    1. Advertising

  2. Andrew Thompson, Aug 9, 2004
    #2
    1. Advertising

  3. Madhur Ahuja

    Madhur Ahuja Guest

    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



    "Andrew Thompson" <> wrote in message
    news:1ieyllam3utm5.zzm89tkz90hr$...
    > On Tue, 10 Aug 2004 02:33:51 +0530, Madhur Ahuja wrote:
    >
    > > Can javax.swing.JoptionPane.showMessageDialog() be used in a Applet.

    >
    > Did you try it?
    >
    > >...If not,
    > > what should I use.

    >
    > If not, why not?
    >
    > --
    > Andrew Thompson
    > http://www.PhySci.org/ Open-source software suite
    > http://www.PhySci.org/codes/ Web & IT Help
    > http://www.1point1C.org/ Science & Technology
     
    Madhur Ahuja, Aug 10, 2004
    #3
  4. "Madhur Ahuja" <> wrote in message
    news:...
    > 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 http://www.iviz.com/
     
    Matt Humphrey, Aug 10, 2004
    #4
  5. On Mon, 9 Aug 2004 19:59:58 -0400, Matt Humphrey wrote:
    > "Madhur Ahuja" <> wrote in message

    ...
    >> 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 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>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Aug 10, 2004
    #5
  6. Madhur Ahuja

    Madhur Ahuja Guest

    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



    "Andrew Thompson" <> wrote in message
    news:...
    > On Mon, 9 Aug 2004 19:59:58 -0400, Matt Humphrey wrote:
    > > "Madhur Ahuja" <> wrote in message

    > ..
    > >> 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 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>
    >
    > --
    > Andrew Thompson
    > http://www.PhySci.org/ Open-source software suite
    > http://www.PhySci.org/codes/ Web & IT Help
    > http://www.1point1C.org/ Science & Technology
     
    Madhur Ahuja, Aug 10, 2004
    #6
  7. On Tue, 10 Aug 2004 12:16:53 +0530, Madhur Ahuja wrote:

    > Actually the problem was the editor JCreator,


    It's a deeper problem than that, try compiling
    running without an IDE..
    <http://www.xdweb.net/~dibblego/java/faq/answers.html#q34>

    >..it was loading the old copy of
    > the class file rather than newly compiled.


    Yeah, yeah, ..blame the IDE. ;-)

    Have some thought about..
    <http://www.physci.org/codes/javafaq.jsp#cljh>

    And please refrain from top-posting Madhur,
    I find it most confusing..
    <http://www.physci.org/codes/javafaq.jsp#netiquette>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Aug 10, 2004
    #7
  8. "Andrew Thompson" <> wrote in message
    news:...
    > On Mon, 9 Aug 2004 19:59:58 -0400, Matt Humphrey wrote:
    > > "Madhur Ahuja" <> wrote in message

    > ..
    > >> 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 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..


    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 http://www.iviz.com/
     
    Matt Humphrey, Aug 10, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey
    Replies:
    7
    Views:
    13,609
    Greg Burns
    Sep 7, 2004
  2. Gnarlodious
    Replies:
    4
    Views:
    17,617
    elizas
    May 5, 2010
  3. Replies:
    0
    Views:
    242
  4. Next
    Replies:
    1
    Views:
    438
    Alvin Bruney
    Nov 19, 2003
  5. Replies:
    1
    Views:
    210
    Laurent Bugnion
    Jun 9, 2006
Loading...

Share This Page