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

JPopupMenus in JFileChooser() don't display properly when added to a glass Pane

XMLWordPrintable

    • Fix Understood
    • x86, sparc
    • solaris_8, windows_2000



      Name: gm110360 Date: 06/24/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
      Java HotSpot(TM) Server VM (build 1.4.1-beta-b14, mixed mode)

      FULL OPERATING SYSTEM VERSION : SunOS altair 5.8
      Generic_108528-14 sun4u sparc SUNW,Ultra-4


      A DESCRIPTION OF THE PROBLEM :
      When a JFileChooser is added to a glass pane the drop down
      menu's do not paint onto the glass pane. A similar bug has
      been reported and a work-around given, but the work around
      is not applicable for the JFileChooser.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Create a container
      2.Create a JFileChooser
      3.add the JFileChooser to the glass pane(to do this you add
      the JFileChooser to a panel, then set the glass pane to that
      panel)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The drop downs for file selection and file type selection
      will not drop down. If the file type selection menu gets
      long enough it will appear to paint behind the glass pane.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.io.*;
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.event.*;
      import java.beans.*;

      class glassTest extends JFrame{
          Container topContainer;
          JFileChooser fileChooser;
          JPanel glass;
          JRootPane rootPane;
          public glassTest() {
      topContainer = getContentPane();
      topContainer.add(new JLabel("test"));
      fileChooser = new JFileChooser();
      rootPane = getRootPane();
      glass = new JPanel();
      glass.add(fileChooser);
      rootPane.setGlassPane(glass);
      glass.setVisible(true);
          }
          public static void main(String[] args)
          {
      glassTest app = new glassTest();
      app.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
      System.exit(0);
      }
        });
      app.pack();
      app.setVisible(true);
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      No work around found.
      (Review ID: 153963)
      ======================================================================

            tr Tejesh R
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: