JDK-8014883 : java.awt.container.add(component comp object constraints) doesn't work as expected on some linux platforms
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2013-05-20
  • Updated: 2013-09-12
  • Resolved: 2013-08-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b103Fixed
Description
Method java.awt.container.add(component comp object constraints) doesn't work as expected on x86, armv7 embedded systems with ubuntu installed.
See result of running next code in attachment (addButtonLayout.JPG)

import java.awt.*;
public class addButtonLayout extends Frame {
  public static void main ( String [] args ) {
    Frame f = new Frame();
    f.setBackground(Color.WHITE) ;
    f.setSize(200,400);
    f.setVisible(true);
    Panel p = new Panel();
    p.setLayout(new BorderLayout());
    p.add(new Button("North"), BorderLayout.NORTH);
    p.add(new Button("South"), BorderLayout.SOUTH);
    p.add(new Button("East"), BorderLayout.EAST);
    p.add(new Button("West"), BorderLayout.WEST);
    p.add(new Button("Center"), BorderLayout.CENTER);
    f.add(p);    
    f.setVisible(true);
  }
}

Reproduced on embedded atom systems with ubuntu 11.04, ubuntu 11.10, ubuntu 12.04 with any build of JDK8.
Not reproduced with any build of JDK7 (see result in attachment - addButtonLayout_jdk7.JPG)


Comments
Note that if the test runs with xrender=True option, it provide the next message: =Start message WARNING: The version of libXrender.so cannot be detected. ,The pipe line will be enabled, but note that versions less than 0.9.3 may cause hangs and crashes See the release notes for more details. XRender pipeline enabled Xrender: INFO: Jules library not installed. =End message Probably instead of a warning, it should move back to the usual x11 pipeline?
04-06-2013

Note that this isn't really new to JDK 8. It can be reproduced in JDK 7 too if you pass the system property which requests xrender to be used.
03-06-2013

It looks as if this may be the same intel driver bug as discussed here :- 8007386: On physical machine (video card is Intel Q45) the case of text is blank. The machine on which I was able to reproduce this (Ubuntu 11.04) was using intel_drv.so and removing that so it fell back to the default fb driver cured the bug even though Xrender was still being used. So this probably affects all Ubuntu releases < 12.10 and other Linux distros of a similar vintage that use this driver version. If the updated driver isn't widely available, we may need to disable Xrender on all X.org servers older than that in 12.10 (ie Xserver version 1.13.0) which would be very unfortunate as the problem seems to be a driver-specific bug and there's no was I know of to tell that its an intel driver being used.
03-06-2013

This works fine for me on the Ubuntu 12.10 x64 using VirtualBox and 64 bit JDK b88.
23-05-2013

Problem related to xrender. Test passed with -Dsun.java2d.opengl=True or -Dsun.java2d.xrender=false
20-05-2013

In what build of jdk8 it was introduced?
20-05-2013