Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7908905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:08:51+00:00 2026-06-03T12:08:51+00:00

I am trying to created a scrolled composite that has a composite with a

  • 0

I am trying to created a scrolled composite that has a composite with a grid layout inside.

However when I try to set the content of the scrolled composite nothing loads.
This appears only to affect composites with grid layouts.

What am I doing wrong?

My Code:

    CTabItem tbtmNotes = new CTabItem(tabFolder, SWT.NONE);
    tbtmNotes.setText("Notes");
    ScrolledComposite scrollComposite = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.BORDER);
    tbtmNotes.setControl(scrollComposite);
    scrollComposite.setContent(new hm_Composites.Comp_Animal_Notes(tabFolder, SWT.None, a));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:08:52+00:00Added an answer on June 3, 2026 at 12:08 pm

    After a bunch of fiddling I got the following to work hope it helps someone else out.

        public Comp_Animal_Notes(Composite parent, int style, Animal a)
            throws Exception {
        super(parent, SWT.NONE);
        setLayout(new FillLayout(SWT.HORIZONTAL));
        ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
        scrolledComposite.setExpandHorizontal(true);
        scrolledComposite.setExpandVertical(true);
    
        Composite composite = new Composite(scrolledComposite, SWT.NONE);
        composite.setLayout(new GridLayout(2, false));
    
        ArrayList<Note> alNotes = a.getAnimalNotes();
        this.setRedraw(false);
        for (int i = 0; i < alNotes.size(); i++) {
            Note note = alNotes.get(i);
    
            CLabel lblNoteDate = new CLabel(composite, SWT.BORDER);
            lblNoteDate.setFont(SWTResourceManager.getFont("Tahoma", 8,
                    SWT.BOLD));
            lblNoteDate.setText("Date:");
            lblNoteDate.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    
            CLabel lblNotedatetxt = new CLabel(composite, SWT.BORDER);
            lblNotedatetxt.setBackground(SWTResourceManager
                    .getColor(SWT.COLOR_WHITE));
            lblNotedatetxt.setText(note.getUserDate());
            lblNotedatetxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    
            CLabel lblNoteTxt = new CLabel(composite, SWT.BORDER);
            lblNoteTxt.setBackground(SWTResourceManager
                    .getColor(SWT.COLOR_WHITE));
            lblNoteTxt.setText(note.getStrNote());
            lblNoteTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
        }
    
        scrolledComposite.setContent(composite);
        scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    
        this.setRedraw(true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a datatable and trying to insert that datatable through SqlBulkCopy but
I created a simple class that shows what I am trying to do without
When I created the project I'm trying to deploy I selected that I wanted
I'm currently trying to created a custom ConfigurationSection for my application, however VS2008 is
I'm trying to created a set of nested (many-to-many) forms in rails 3. Everything
I have a RadGrid that has it's rows and columns being created programatically, and
have created a map that I'm trying to have function similar to 'My Maps'.
Trying to read the sizes of disks that were created in multiple sessions using
Im trying to load a page I created using ajax, which loads fine and
I am trying to create a page that has a scroller of images and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.