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

JPopupMenu ignores transparency if opened above (invisible) windows task bar

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6u10
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_13"
      Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
      Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

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

      A DESCRIPTION OF THE PROBLEM :
      When running a full screen JFrame (bounds matches screen size), opening a non opaque JPopupMenu overlapping a windows task bar (beneath the JFrame) will ignore the non opaqueness

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - be sure to have a present windows task bar (not auto hiding)
      - run attached source
      - right click far from windows task bar and notice transparency of JPopupMenu
      - right click to open JPopupMenu over task bar and notice lack of transparency of JPopupMenu

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When opening a JPopupMenu in a full screen JFrame, I expected that the JPopupMenu could remain non opaque no matter where it is opened.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Color;
      import java.awt.Dimension;
      import java.awt.Font;
      import java.awt.Rectangle;
      import java.awt.Toolkit;
      import java.awt.event.MouseAdapter;
      import java.awt.event.MouseEvent;

      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import javax.swing.JPopupMenu;

      public class TransparencyPopupNearBorderTest {
          public static void main(String[] args) {
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setLocationRelativeTo(null);
              final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              System.out.println("Task bar insets at bottom: "
                      + Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration()).bottom);
              frame.setBounds(new Rectangle(screenSize));
              frame.setUndecorated(true);
              frame.setPreferredSize(screenSize);
              frame.addMouseListener(new MouseAdapter() {
                  @Override
                  public void mouseReleased(MouseEvent e) {
                      JPopupMenu popup = new JPopupMenu();
                      popup.setOpaque(false);
                      JLabel label = new JLabel("TRANSPARENT");
                      label.setFont(new Font("Helvetica", Font.PLAIN, 42));
                      popup.add(label);
                      popup.show(frame, e.getX(), e.getY());
                      System.out.println("popup bottom edge is "
                              + (screenSize.height - e.getY() - popup.getPreferredSize().height) + " from screen bottom");
                  }
              });
              frame.getContentPane().setBackground(Color.BLUE);
              frame.pack();
              frame.setVisible(true);
          }
      }

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

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: