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

Undecorated frame with transparent background does not show its content

XMLWordPrintable

    • 2d
    • linux_ubuntu

      import java.awt.Color;
      import java.awt.Frame;
      import java.awt.Label;
      import static java.awt.EventQueue.invokeAndWait;

      public class AWT {
          public static void main(String[] args) throws Exception {
              invokeAndWait(() -> {
                  Frame frame = new Frame();
                  frame.add(new Label("TEST"));
                  frame.setUndecorated(true);
                  frame.setBackground(new Color(0f, 1f, 0f, 0.5f));
                  frame.setBounds(200, 200, 200, 200);
                  frame.setVisible(true);
              });
          }
      }

      The code above shows a label with the following cmd:
      java -Dsun.java2d.xrender=false AWT

      The code above does not show a label with the following cmd:
      java -Dsun.java2d.xrender=true AWT

        1. Linux-x86_64-Jdk1.8.0_91.png
          81 kB
          Prahalad Kumar Narayanan
        2. Linux-x86_64-Jdk1.8.0_91-xRenderFalse.png
          90 kB
          Prahalad Kumar Narayanan
        3. Linux-x86_64-Jdk9-internal.png
          85 kB
          Prahalad Kumar Narayanan

            prr Philip Race
            malenkov Sergey Malenkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: