Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4195142

Not able to create a modal dialog box from JApplet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • bdk_1.0, 1.1
    • deploy
    • x86
    • solaris_2.6, windows_nt



      Name: jd32717 Date: 12/04/98


      Create a JApplet class. Create a JInternalFrame object
      and Create a JOptionPane object by passing Jinternal
      Frame object as a parent component. I am able to access
      JInteranlframe very well. I am able to iconify the
      Jinternal frame easily without any problem. This
      defeats the purpose of modalness.

      SourceCode:
      package imp.client_ui_error;

      import com.sun.java.swing.*;
      import com.sun.java.swing.event.*;
      import com.sun.java.swing.text.*;
      import java.awt.*;
      import java.awt.event.*;


      public class TestApplet extends JApplet
      {

      public JInternalFrame testFrame;
      public TestApplet()
      {
      }


      public void init()
      {
             
      testFrame = new JInternalFrame("TestFrame", true,true, true,true);
      testFrame.setPreferredSize(new Dimension(this.getSize().width-20,this.getSize().height -120));
      testFrame.pack();
      testFrame.show();
      this.getLayeredPane().add(testFrame,"Center");

      //Creates a message modal dialog

      testFrame.addMouseListener(new MouseAdapter()
      {
      public void mouseClicked(MouseEvent e)
      {
      JOptionPane.showMessageDialog(testFrame,
                                          "Eggs aren't supposed to be green.",
                                          "A plain message",
                                          JOptionPane.PLAIN_MESSAGE);
      }
      });

      }




      }

      HTML SOURCE:

      <html>
      <head>
      <title>TestApplet</title>
      </head>
      <body>



      <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
      WIDTH = 800 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.1.1/jinstall-111-win32.cab#Version=1,1,1,0
      ">

      <PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
          <PARAM NAME="code" VALUE="imp.client_ui_error.TestApplet.class">
      <PARAM NAME="codebase" VALUE=".">
      <PARAM NAME = "gateway_url" VALUE = "http://itdw1060/imptest/">
      <PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
          <COMMENT>
              <EMBED type="application/x-java-applet;version=1.1" width="600"
                height="800" align="baseline" code="imp.client_ui_error.TestApplet.class"
      CODEBASE="."
      pluginspage="http://java.sun.com/products/plugin/1.1/plugin-install.html">

              <NOEMBED>
              </COMMENT>
                    No JDK 1.1 support for APPLET!!
              </NOEMBED></EMBED>
          </OBJECT>



      </body>
      </html>
      (Review ID: 39268)
      ======================================================================

            stanleyh Stanley Ho (Inactive)
            jdochezorcl Jerome Dochez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: