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

Undecorated JFrame do not get out of the screen when open in unsigned JApplet.

XMLWordPrintable

    • 6u3
    • x86
    • windows_vista

      FULL PRODUCT VERSION :
      jre 1.5.0_13, jre 1.6.0_03

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [version 5.1], Microsoft Windows Vista [version 6.0]

      A DESCRIPTION OF THE PROBLEM :
      The JFrame can not be dragged outside the screen bounds.
      In case it is resized from its left and/or bottom side and the mouse is at the left and/or bottom side of the screen, the JFrame resize from the right and/or top side of it.
      In both cases, it can not be dragged outside the screen.

      However, the JFrame can be dragged out of bounds in the following cases:

      1. add in the .java.policy file the grant:
      grant {
      permission java.awt.AWTPermission "showWindowWithoutWarningBanner";
      };
      2. set the method JFrame.setUndecored(false);
      3. use the "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" look and feel.
      3. sign the applet, (this will disable the warning banner "Java Applet Window").

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a simple JApplet.
      2. Set the Metal look and feel and the JFrame.setDefaultLookAndFeelDecorated(true);
      3. Open a JFrame from the JApplet.
      4. Try to drag the frame out of the screen bounds.

      The applet must run in a web browser, not in the sun.applet.AppletViewer opened from a Java IDE.

      In my example, I didn't set the Metal look and feel because it is the default one.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When dragging the JFrame outside the screen bounds, I expect it to go outside the screen bounds ...
      ACTUAL -
      ... but it did't. It remain bind of the screen margins.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Run the following applet in a web browser (eg. Internet Explorer).

      ====================================================

      import javax.swing.JApplet;
      import javax.swing.JFrame;

      public class UndecoredFrameTest extends JApplet {

      public void init() {
      JFrame.setDefaultLookAndFeelDecorated(true);

      JFrame frame = new JFrame();
      frame.setBounds(800, 100, 800, 600);
      frame.setVisible(true);
      }

      }

      ====================================================

      A simple html to open the applet:

      ====================================================

      <html>
      <head>
      <title>Undecored Frame</title>
      </head>
      <body>
      <applet code="UndecoredFrameTest.class"/>
      </body>
      </html>

      ====================================================
      ---------- END SOURCE ----------

      Release Regression From : 6u2
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

            anthony Anthony Petrov (Inactive)
            son Oleg Sukhodolsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: