0

I got a List:

final List list = new List(shell, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI );

Which I try to add text too including "\n":

list.add("123 \n 1234");

The result is an list item with only the text

123 1234

in it but I want the result:

123
1234

How can I make this possible?

Baz
  • 36,440
  • 11
  • 68
  • 94
Jedi Schmedi
  • 746
  • 10
  • 36

1 Answers1

0

Native multi-lines are not supported in SWT list/table/tree (due to Windows limitations). You could use TableViewer with owner-draw but you will have all your rows with same hight (again, Windows thing). Or you could use some alternative implementations.

Community
  • 1
  • 1
Martti Käärik
  • 3,601
  • 18
  • 28