nits.kk nits.kk - 3 months ago 27
Java Question

Applying Header text (title) to a ScrolledComposite having a GridLayout

I am having a

with Layout set as
and data set as
. This I am using on a
Graphical editor

I need to add a heading to the composite which I wish to be static in place and not get scrolled up as the content of the scrolled composite is scrolled up.

I tried adding a label in the scrolled composite but as the contents of the grid is populated the label is hidden, which I suppose is due to the grid view taking the space occupied by thw label.


I solved this by adding a Group as a parent Composite to my ScrolledComposite. The java class Group extends Composite and also has an option to setting the Text. I applied the font data to the text and I was able to add the header.