JDK-4684679 : Choice menu is not displayed in hopper build-11
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS:
    linux_redhat_7.2,solaris_7,solaris_8 linux_redhat_7.2,solaris_7,solaris_8
  • CPU: x86,sparc
  • Submitted: 2002-05-14
  • Updated: 2002-06-03
  • Resolved: 2002-05-23
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.
Other
1.4.1 betaFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Build: 11
OS   :   Sparc and linux


Tests that are failing:  

/demo/applets/Cardtest/example1.html
/demo/applets/Drawtest/example1.html
/demo/applets/Graphicstest/example1.html
/demo/applets/Symboltest/example1.html


java -version:
==============
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b11)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b11, mixed mode)


Here is a Sample Program for Choice.

// Source Code fileName:- ChoiceDemo.java
import java.applet.Applet;
import java.awt.Choice;

public class ChoiceDemo extends Applet {

  public void init() {
    Choice ch = new Choice();
    ch.addItem("6 inches");
    ch.addItem("9 inches");
    ch.addItem("12 inches");
    ch.addItem("16 inches");
    ch.addItem("20 inches");
    add(ch);
  }


}

// Corresponding HTML file... FileName:- example.html
<html>
<body>
<APPLET code=ChoiceDemo.class width="100" height="100">
</APPLET>
</body>
</html>

=========================================
Steps to reproduce the problem.
=========================================
1. Set the path to hopper-Build-11
2. Compile the ChoiceDemo.java
3. run appletviewer example.html using hopper-build-11.

Problem:-  The drop down menu is not displayed.

4. In hopper build-10, with the same code mentioned above, the drop down menu is displayed.

5. This is reproducible on solaris sparc and  linux .  


Note: These test are failing when executed in appletviewer .

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper-beta FIXED IN: hopper-beta INTEGRATED IN: hopper-beta VERIFIED IN: hopper-beta
14-06-2004

SUGGESTED FIX ------- awt_Choice21.c ------- *** /tmp/sccs.13aODw Wed May 15 22:56:15 2002 --- awt_Choice21.c Wed May 15 22:49:29 2002 *************** *** 288,295 **** */ /* Set the width and height of the TextField widget. */ XtVaSetValues(text, ! XmNwidth, &width, ! XmNheight, &height, NULL); XtAddCallback(list, --- 288,295 ---- */ /* Set the width and height of the TextField widget. */ XtVaSetValues(text, ! XmNwidth, width, ! XmNheight, height, NULL); XtAddCallback(list, *************** *** 587,594 **** * the width of the TextField because it is the widget actually seen. */ XtVaSetValues(text, ! XmNwidth, &width, ! XmNheight, &height, NULL); awt_util_reshape(cdata->comp.widget, x, y, width, height); --- 587,594 ---- * the width of the TextField because it is the widget actually seen. */ XtVaSetValues(text, ! XmNwidth, width, ! XmNheight, height, NULL); awt_util_reshape(cdata->comp.widget, x, y, width, height);
11-06-2004

PUBLIC COMMENTS I had verified this bug in build13 on sparc and linux and it is working fine .
10-06-2004

EVALUATION Name: rpR10076 Date: 05/15/2002 ###@###.### The problem is as follows. Currently, awt uses motif21 combobox widget to implement Choice on X11 platform. This combobox is compound and contains label field and a button for drop down menu. In build11, label field is too big (can be seen using editres with debug version of java or appletviewer) and the button is just buried under it. That is why Choice doesn't work. The size of text label is probably too big because of incorrect calculation of text size. This incorrect behaviour was introduced with the fix for 4615396 Swing: chinese text cann't show when select 'WindowsLookAndFeel' This was done by both Swing and 2D teams, and 2D changes were all font-related. When I backed out this fix, everything became just as in were in build 10. To backout, I performed the following operations: src/share/native/sun/awt/font/fontmanager/fontobjects/s.fontObject.cpp returned to delta 1.132 src/share/native/sun/awt/font/fontmanager/include/s.fontObject.h returned to delta 1.47 src/share/native/sun/awt/font/s.FontWrapper.cpp returned to delta 1.52 src/share/classes/sun/awt/font/NativeFontWrapper.java returned to delta 1.57 src/share/classes/sun/java2d/SunGraphicsEnvironment.java Manually removed method "fontSupportsDefaultEncoding(Font)", since there are deltas on top of it and it cannot be backed out automatically. The original fix also changed WindowsLookAndFeel.java, but for this problem it is irrelevant. After all the above steps were made, the behaviour returned to the one of build 10. A side note: the fix for 4615396 also broke textfields, it can be observed with SymbolTest demo. With build 11, the digits in the "Unicode Base" textfield can only be seen partially (like one upper half of each digit), while with that fix backed out or with build 10 they can be seen normally. ====================================================================== The notes in the description about most of the changes here are bogus and backing out those changes makes no difference. The change that is relevant is a change in AppletPanel.java which explicitly sets a font. That code is not doing anything wrong and the real bug is elsewhere. This is most readily demonstrated by changing ChoiceDemo.java to add one line :- import java.applet.Applet; import java.awt.Choice; public class ChoiceDemo extends Applet { public void init() { Choice ch = new Choice(); ch.addItem("6 inches"); ch.addItem("9 inches"); ch.addItem("12 inches"); ch.addItem("16 inches"); ch.addItem("20 inches"); add(ch); setFont(getFont()); // << ADD JUST THIS ONE LINE } } and running on JDK 1.4 FCS and you will see the same problem. So it appears to be something to do with premature layout by Choice. The same code works fine in all JDK's and the problem first appears in JDK 1.4 RC (JDK 1.4 Beta 3 is fine). ###@###.### 2002-05-15 ============================ I think I've traced this back. the 2D build of 18-nov-01 was OK. On 26th we synced with the master and picked up this AWT change:- Fixed 4477410 : List widget of Prefix, Job function etc. does not appear on solr egis During initialization the width/height of the XmComboBox widget get set to zero, because they are not set in the Java component. Set the width/height of the TextField of the XmComboBox in pReshape and update their values in the Java Choice component. The very next 2D build (27-nov) exhibits the problem, ###@###.### 2002-05-15 ============================ Removed & from width and height parameters to XtVaSetValues in create and pReshape. See Suggested Fix. ###@###.### 2002-05-15 With the above partial fix, these failures remain: CardTest still fails on Solaris and Linux. DrawTest still fails on Linux. ###@###.### 2002-05-16 See Bug 4690104 for the rest of the fix. ###@###.### 2002-05-22
16-05-2002