Community
Participate
Working Groups
1) Execute the following class. 2) Drop down the combo box and select the value "1.2" 3) Notice that all you can see is ".2" [ package test; import com.ibm.swt.*; import com.ibm.swt.graphics.*; import com.ibm.swt.widgets.*; public class PR_1G1AD9Y { public static void main(String[] args) { Shell shell= new Shell(); Display display = shell.getDisplay(); Combo combo = new Combo(shell, SWT.NULL); Font font = new Font(display, "Times", 20, 0); combo.setFont(font); combo.setItems (new String [] { "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2", "3", "4", "5", "6", "7", "8", "9", "10"}); combo.select(combo.indexOf("1")); combo.pack (); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } font.dispose(); } } ] NOTES: CM (9/14/00 5:18:13 PM) The value is scrolled to the right - if you move the text cursor to the left you can see the beginning of the "1.2". CM (9/14/00 5:19:32 PM) If you set SWT.READ_ONLY when you create the combo, then the bogus behavior does not happen (because there is no text cursor). CM (9/14/00 5:21:11 PM) This is not a problem for courier, Script, and Ariel. Note however that "Comic Sans MS" also fails in the same manner. Did not try any other fonts. SN (2/5/01 1:08:53 PM) SN to fix. (base on fix for 1 line text)
PRODUCT VERSION: SWT win32 0.047a
Fixed > 20020815