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

Setting maximized state of JFrame still does not work properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: