From owner-freebsd-java@FreeBSD.ORG Thu Feb 26 12:42:24 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 083A116A4CE for ; Thu, 26 Feb 2004 12:42:24 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id B55B043D2F for ; Thu, 26 Feb 2004 12:42:23 -0800 (PST) (envelope-from bjorn@sccs.swarthmore.edu) Received: (qmail 5544 invoked from network); 26 Feb 2004 20:42:23 -0000 Received: from dsl027-161-202.atl1.dsl.speakeasy.net (HELO twiggy) ([216.27.161.202]) (envelope-sender )encrypted SMTP for ; 26 Feb 2004 20:42:23 -0000 Date: Thu, 26 Feb 2004 15:43:14 -0500 (EST) From: Bjorn Dittmer-Roche X-X-Sender: bjorn@twiggy.bjorn.is-a-geek.com To: freebsd-java@freebsd.org Message-ID: <20040226153218.E317@twiggy.bjorn.is-a-geek.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: bug in jdk1.4 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 20:42:24 -0000 Hey all, I'm pretty sure this is a bug in FreeBSD's java implementation, but I suppose it could be a problem almost anywhere. Basically, when you run the program below, the JDialog (JOptionPane) appears *behind* the JWindow instead of in front of it, unless the JWindow has keyboard focus. This is very bad if the window is bigger than the dialog as it obscures the dialog box. Linux does not exibit this behaviour. It can be worked around using an undecorated JFrame, which is what I'm doing in my big application, but that's not compatible with java 1.3, and it's not necessary on other platforms. Here's what I'm using: twiggy:~> uname -a FreeBSD twiggy 4.9-STABLE FreeBSD 4.9-STABLE #2: Wed Jan 14 17:21:22 EST 2004 root@twiggy:/usr/obj/usr/src/sys/TWIGGY i386 twiggy:~> java -version java version "1.4.2-p6" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-p6-root_23_feb_2004_13_28) Java HotSpot(TM) Client VM (build 1.4.2-p6-root_23_feb_2004_13_28, mixed mode) I am also using KDE with "focus strictly under mouse". Sun won't accept the bug report because it's not for linux, solaris or windows. Let me know what I can do. thanks, bjorn ------------------------- import javax.swing.*; import java.awt.event.*; import java.awt.*; public final class BuggyWindow2 extends JWindow implements Runnable { JTextField jtf; JTextArea jta; public static void main( String args[] ) { BuggyWindow2 bw2; (bw2 = new BuggyWindow2()).show(); try { Thread.sleep(1000); } catch (InterruptedException ie) {} SwingUtilities.invokeLater( bw2 ); } public BuggyWindow2() { //setUndecorated( true ); getContentPane().add( new JLabel( "Hello" ) ); pack(); } public void run() { JOptionPane.showMessageDialog( this, "This should be on top", "This should be on top", JOptionPane.PLAIN_MESSAGE ); } }