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

Setting maximized state of JFrame still does not work properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 6
    • client-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_05-ea"
      Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b05, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Initial setting the maximized state of JFrame does still not work, if the content pane is set or a component is added to the content pane.
      This bug report is similar to bug report Id 4464714, except the setting of the content pane.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run example source code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The frame should appear in maximized state.
      ACTUAL -
      The frame appears in normal state.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class Maxim extends JFrame {

      public Maxim() {
      super();
      JPanel content =new JPanel();
      setContentPane(content);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      setExtendedState(MAXIMIZED_BOTH);
      }

      public static void main(String args[]){

      // thread safe packing
      Runnable show = new Runnable() {
      public void run() {
      Maxim mf = new Maxim();
      mf.pack();
      mf.setVisible(true);
      //mf.setExtendedState(MAXIMIZED_BOTH);
      }
      };
      SwingUtilities.invokeLater(show);
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Call setExtendedState(MAXIMIZED_BOTH) after showing the frame.

            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: