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

JWindow all white after screensaver on multi monitor system

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.10586]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The system appears to have to run 2 monitors with the left monitor being the main monitor.

      A DESCRIPTION OF THE PROBLEM :
      Mousing over JButtons on a multimonitor machine after the screensaver has gone off destroys most of the JWindow contents. This is critical because we need a JWindow with a translucent background so any portion of the window where all elements have an alpha of 0 will allow the mouse to go through the window to the system desktop.

      The key parts appear to be:
      the background of the window has an alpha of 0
      There must be 2 JWindows with different sizes
      There must be a JButton (the mouseover animation appears to be the trigger)

      There must be 2 monitors
      The system screensaver must execute


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the java program.
      let the windows screensaver run OR use preview screensaver (I used blank screen as the screensaver)
      move the mouse to exit the screensaver and mouse over the two JButtons
      As the mouse exits the left JButton, the background of the entire window is destroyed and becomes entirely white. The JLabel is also no longer visible.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the window to show a button and label with a pink background
      ACTUAL -
      The window shows a button with the rest of the window colored white.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Color;

      import javax.swing.JButton;
      import javax.swing.JLabel;
      import javax.swing.JPanel;
      import javax.swing.JWindow;


      public class TransparentBug extends JWindow {
      private static final long serialVersionUID = 1075883583685353184L;

      public static void main(String[] args) {
      TransparentBug tp1 = new TransparentBug();
      tp1.setLocation(1, 1);
      tp1.setSize(90,100);
      TransparentBug tp2 = new TransparentBug();
      tp2.setLocation(110,1);
      tp2.setSize(91, 100);
      }

      public TransparentBug(){
      this.setBackground(new Color(0,0,0,0));
      JPanel contentPane = new JPanel();
      contentPane.setBackground(Color.pink);
      this.setContentPane(contentPane);
      JButton jbutton = new JButton("button");
      contentPane.add(jbutton);
      contentPane.add(new JLabel("This text is lost"));
      setVisible(true);
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None Known

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: