JDK-4137883 : java.awt.Dialog won't display on NCD xterm
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1998-05-13
  • Updated: 2006-01-23
  • Resolved: 2006-01-23
Related Reports
Relates :  
Description
Name: tb29552			Date: 05/13/98


When running on Sun machine and displaying on an NCD xterm
the following will just hang:
__

import java.awt.*;

public class DialogTest
  {
  public static void main( String[] args )
    {
    Frame f = new Frame();
    Dialog d = new Dialog( f );
    f.show();
    d.show();
    }
  }
__

The NCD X server messages displays an error saying:

XSERVER-E-BADWINDOWSIZE, window dimensions 65526 65506 too large
(Review ID: 25785)
======================================================================

Comments
WORK AROUND tim.bell@Eng 1998-05-15 You can get the dialog to appear (and no error message) by setting the size using setSize() before showing it EG: // WORKS! import java.awt.*; public class DialogTest { public static void main( String[] args ) { Frame f = new Frame(); Dialog d = new Dialog( f ); f.show(); d.setSize( 100, 100 ); d.show(); } } ====================================================================== Name: tb29552 Date: 05/13/98 The problem with Java not displaying on an NCD xterm appears to be a combination of three things: 1) Symptom: it hangs when you start a java awt application Cause: not having the correct colour properties setup on your X display Cure: use an xstdcmap command to set them up before running java 2) Symptom: it seg faults when you run a java awt application Cause: not having the correct font properties set up Cure: commenting out the offending font from lib/font_properties 3) Symptom: dialog boxes not appearing Cause: the JDK setting the default size of the boxes to a v.large number Cure: editing java/awt/Dialog.java to set the size to something sensible updating the class in the lib/classes.zip file The workaround you forwarded to me fixed the second (fonts) problem. The first (colormap) problem is intermittent - it depends on the window manager and other applications in use - especially if they use a lot of colour (e.g. netscape or a photographic backdrop). This is usually fixed by quitting all colour intensive applications and running "xstdcmap -display $DISPLAY -all" before running java - but this doesn't always work. Once those two problems are worked around - the final problem is specifically to do with the Dialog classes - all the other windowing code works fine (AFAICT). Essentially the X server complains with the following message when you try to display a dialog box: XSERVER-E-BADWINDOWSIZE, window dimensions 65526 65506 too large You can get it to work properly by editing the source for java/awt/Dialog.java and inserting the following line at the end of the fourth constructor: public Dialog(Frame parent, String title, boolean modal) { : : setSize( -65526, -65506 ); } __ Then compile and update the classes.zip file with a command something like: __ zip -f $JAVA_HOME/lib/classes.zip java/awt/Dialog.class __ This works with JDK 1.1.5 and the JDK supplied with JWS2.0. This obviously compensates for the massive window dimensions and brings the size down to a displayable level. The dialog box will then be displayed, but it'll be very small! My guess is that something odd is happening when the Dialog is created - possibly something like the window being adjusted to be smaller than its parent? And that somehow this is creating a negative size, causing a signing error on the size sent to the X server (where -1 = 65536)? Just random thoughts...
17-09-2004