Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8584901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:52:56+00:00 2026-06-11T21:52:56+00:00

There appears to be a bug with the window translucency functionality in Java 7

  • 0

There appears to be a bug with the window translucency functionality in Java 7 (I believe the problem existed in Java 6 as well). If I open a translucent window and then minimize its parent window, both disappear as you would expect. But then when you restore the parent window the translucent window never reappears. However, it is still there and will consume input as if nothing was wrong.

Here is my SSCCE:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class BrokenTranslucentWindow extends JApplet //same problem exists using a JFrame
{
    public BrokenTranslucentWindow()
    {
        JButton b = new JButton("Hello");
        b.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent e)
            {
                JDialog d = new JDialog(Window.getWindows()[0])
                {
                    @Override
                    public void paint(Graphics g)
                    {
                        g.fillOval(0, 0, getWidth(), getHeight());
                    }
                };
                d.setUndecorated(true);
                d.setBackground(new Color(0, 0, 0, 0));
                d.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                d.setSize(300, 300);
                d.setLocationRelativeTo(null);
                // d.setModal(true);
                d.setVisible(true);
            }
        });
        this.add(b);
    }
}

You’ll note that after you restore the parent window the translucent oval window will not be visible, but your cursor will still change to the hand cursor when you are over the area where the window should be.

I have submitted the bug to Oracle, but until it is fixed I could really use a better workaround.

My Question:

Does anybody have any ideas for a workaround that would prevent this from happening?

Fun Facts:

  • This causes big problems if the translucent window happened to be modal.
  • I’m focusing on per-pixel translucency, but the same applies to uniform translucency.
  • This problem presents with JFrames, Applets inside browsers, and Applets within the applet viewer.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:52:57+00:00Added an answer on June 11, 2026 at 9:52 pm

    I have found one undesirable workaround. I post it in hopes that it will get some creative juices going. The workaround is to turn off the translucency when the window is deactivated, and turn it back on when it is activated.

    d.addWindowListener(new WindowAdapter()
    {
        public void windowActivated(WindowEvent e)
        {
            d.setBackground(new Color(0, 0, 0, 0));
        }
    
        public void windowDeactivated(WindowEvent e)
        {
            d.setBackground(Color.white);
        }
    });
    

    This isn’t ideal because when you click off of the window it becomes opaque. However, it does prevent the window from disappearing forever.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It appears to me that there is a problem in Android's coordinate system. When
There appears to be a WebKit bug that does not apply a hover state
In CruiseControl.NET there appears to be the same xsl stylesheets in the server directory
In the AS3 XML class there appears to be two ways of getting the
I am working on a .NET application where there appears to be a memory
From the answers to this question it appears there's a file somewhere on our
Is there an option to enable the drop down menu that appears when coding
Is there any way to convert the image so it appears as a gray
Is there an event that fires in vb.net just before a contextMenuStrip appears when
Although the question title appears a bit subjective I am sure there is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.