• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invisible Label [SWT]

Don Oxley
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create an SWT Form which displays a series of labeled text boxes. The problem is that labels other than the first do not display. I've reduced the failing code to the sequence below. This will display the first label (l1) but not the second. I've removed text boxes which were associated with the labels. When the text boxes were present, they display without the associated label.

I'm either doing something silly (likely) or there may be a property of Groups or Sashes (which is the container for the Group) that I'm unaware of. Any guidance very much appreciated. I've searched Javaranch, Google, and the docs to no avail.

Thanks Much,

Group fillGroup = new Group(gridSash, SWT.NONE);
fillGroup.setLayout(new FormLayout());

final Label l1 = new Label(fillGroup, SWT.RIGHT);
l1.setText("Board No: ");
FormData fd = new FormData();
fd.top = new FormAttachment(10,10);
fd.left = new FormAttachment(0,10);
fd.right = new FormAttachment(40,0);
fd.bottom = new FormAttachment(40,0);

final Label l2 = new Label(fillGroup, SWT.RIGHT);
l2.setText("Row (1): ");
FormData fd1 = new FormData();
fd1.top = new FormAttachment(l1,20);
fd1.left = new FormAttachment(20,10);
fd1.right = new FormAttachment(40,0);
fd1.bottom = new FormAttachment(40,0);
[ October 27, 2005: Message edited by: Ilja Preuss ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic