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

Frame maximizes and covers taskbar using setUndecorated method

XMLWordPrintable

    • generic, x86
    • generic, windows_xp

      When using setUndecorated on a frame, clicking on the maximize button causes the window to cover up the taskbar area on the screen. However, when you do not use this method, the screen only maximizes up to the top of the taskbar. Is this the intended behavior? I did not find any info on this in the api docs under setUndecorated. This maybe something worth mentioning in the docs.

      Try running the code below with setUndecorated and without.

      I compiled and ran the following code below with 1.5 b33 on Win 2k
      ------------------------------------------------------------------
      import javax.swing.*;

      public class JFrameTest2 {

              public static void main(String[] args) {
                      new JFrameTest2();
              }

              public JFrameTest2() {

                      JFrame frame = new JFrame();
                      frame.setUndecorated(true);
                      frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

                      JDesktopPane desktop = new JDesktopPane();
                      frame.setContentPane(desktop);
                      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      frame.setSize(300,300);
                      frame.setVisible(true);
              }
      }
      ------------------------------------------------------------------

            shickeysunw Shannon Hickey (Inactive)
            sjchan Steven Chan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: