Community
Participate
Working Groups
RJS (10/15/99 2:16:55 PM) Execute the following code for a RichText widget, only 4 characters are returned by get text Shell shell = new Shell(); RichText rText = new RichText(shell, SWT.SINGLE); rText.setText("0123"+ RichText.DELIMITER+"4567890"); System.out.println(rText.getText()); System.out.println(String.valueOf(rText.getText().length())); shell.dispose(); Execute the following code for a Text widget, 13 characters are returned including the delimiter Shell shell = new Shell(); Text rText = new Text(shell, SWT.SINGLE); rText.setText("0123"+ Text.DELIMITER+"4567890"); System.out.println(rText.getText()); System.out.println(String.valueOf(rText.getText().length())); shell.dispose(); NOTES: KH (10/18/99 12:02:04 PM) Pls find out why this is happening. KC (10/18/99 2:28:22 PM) This is an invalid test case. If the style for rText is set to SWT.MULTI, then it returns as expected. Single line Text or RichText shouldn't contain multiple lines. Maybe there should be a exception when the code tries to do this. KH (10/22/99 3:55:19 PM) No the test case is valid. Both widgets are set to SWT.SINGLE. The problem is that when you put multiple lines of text in them they return different results. McQ (2/1/01 2:11:08 PM) - Putting multiple lines of text into a text widget which has been marked SINGLE is an undefined state. Application error. McQ to update comment in doc.
PRODUCT VERSION: SWT 0.31
Comment has been updated.