View Single Post
  #1 (permalink)  
Old September 19th, 2008, 04:07 PM
red5 red5 is offline
Registered User
 
Join Date: Sep 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default WrapLines.java example not wrapping text

--------------------
Problem
--------------------

I ran the chapter 8 example in the Java Native Interfaces book that is supposed to show how to create a multi-line text box with line wrap in Java SWT. However, the text isn't wrapping...

--------------------
Details
---------------------

I am running the example in com.asprise.books.javaui.ch08.WrapLines.java. In Fig 8-1 on pg 178 it shows a window with two text boxes. The left text box does not wrap text, the entire text appears on 1 line. The right text in this picture shows a multi-line text box where the text is wrapping, as one would expect. Naturally I expected the example code to create a window that looked like this picture...

However, when I run the example, neither of the text boxes wraps text. The left and right text boxes appear identical. This is odd, since the right text box constructor is passed the SWT.WRAP flag.

Any ideas?

------------------------
Environment
------------------------

I am running

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

on Ubuntu 8.04


Reply With Quote