JLayeredPane with transparent layer causes incorrect drawing

I have a JLayeredPane that has two layers. The top level is fully transparent and acts as a glass pane that captures mouse events and then dispatches them to the pane beneath it. The bottom layer does not draw correctly for an unknown reason. Do I have to dispatch painting events to it or something else?

By the way, I would use the Frame's glass pane, but I cannot get at it. I am stuck using a JPanel that is provided by the GUI framework built on top of Swing. I tried using SwingUtilities to get at the parent frame, but it always returns null.

Answers


If you want to use a glasspane and capture Events in Swing use the JLayer (Java 7). If you do not use Java 7 you can use the JXLayer (http://java.net/projects/jxlayer/). This is the new swing default component for this behavior. See


Need Your Help

Why would a maven-war-plugin generate a JAR instead of a WAR?

maven maven-3 maven-plugin maven-war-plugin

I am following this Contract first using CXF tutorial and while the resulting pom.xml generates sources and even completes build successfully, it fails to create a WAR file.

Command line piping four commands

python command-line

I'm doing two python scripts that was to work with other two programs given by the professor of the subject.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.