From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28283 invoked by alias); 9 Feb 2005 17:35:37 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 28258 invoked by uid 48); 9 Feb 2005 17:35:36 -0000 Date: Wed, 09 Feb 2005 17:48:00 -0000 From: "hendrich at informatik dot uni-hamburg dot de" To: java-prs@gcc.gnu.org Message-ID: <20050209173532.19861.hendrich@informatik.uni-hamburg.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug AWT/19861] New: Swing JOptionPane without parent frame X-Bugzilla-Reason: CC X-SW-Source: 2005-q1/txt/msg00320.txt.bz2 List-Id: The following testcase shows a (subtle) problem in the Swing rendering strategy. A JOptionPane dialog without any parent works fine, but a JOptionPane attached to a non-showing parent (e.g. JFrame) fails with an IllegalComponentStateException. Because the Exception blocks the Swing redraw thread, there is no way to recover from the illegal state. (both dialog windows work fine under JDK 1.4.2, not tested with other versions). /* NoParentJOptionPane.java * * demonstrates GCJ doesn't like dialogs without visible parents... * * (C) 2005 FNH */ import java.awt.*; import javax.swing.*; public class NoParentJOptionPane { public static void main( String args[] ) { String s = "Testing JOptionPane w/o parent..."; System.out.println( "The first call works: null parent:" ); JOptionPane.showMessageDialog( null, s ); // JDK1.4+ runs this, gcj complains about: // java.awt.IllegalComponentStateException: component not showing // at java.awt.Component.getLocationOnScreen() // at javax.swing.SwingUtilities.convertPointToScreen(java.awt.Point, java.awt.Component) // at javax.swing.SwingUtilities.convertPoint(java.awt.Component, int, int, java.awt.Component) (/usr/lib/lib-javax-swing.so.0.0.0) // ... JFrame frame = new JFrame( "just a hidden frame" ); System.out.println( "The second call is broken: frame parent" ); JOptionPane.showMessageDialog( frame, s ); System.exit( 0 ); } } -- Summary: Swing JOptionPane without parent frame Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: AWT AssignedTo: fitzsim at redhat dot com ReportedBy: hendrich at informatik dot uni-hamburg dot de CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19861