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 7748189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:43:05+00:00 2026-06-01T10:43:05+00:00

I have a composite and want to add a table to it. So far

  • 0

I have a composite and want to add a table to it. So far so good, but the table has in the beginning no input, so only the header appears on the composite. But I want the table to have a default (minimum) height (width should be managed by the GridLayout of the composite).
The composite grabs the vertical and horizontal space of its parent so there should be enough space for the table.
I add the table like this:

//comp is my composite
TableViewer viewer = new TableViewer(comp);
viewer.getTable().setHeaderVisible(true);
//Add two TableViewerColumns
//300 should be the minimum / default height
viewer.computeSize(SWT.DEFAULT, 300);

There is nothing else added to the composite and the composite seems to grab all the empty space from its parent but the table does not expand to a height of 300 (width is correct!).

I hope you can understand my problem:)

  • 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-01T10:43:06+00:00Added an answer on June 1, 2026 at 10:43 am

    computeSize returns a Point, which represents the preferred size of the table – this does not actually set the size of the component as the layout can ignore the preferred size

    If you want an absolute fixed height for a table, you can do this by setting the table’s parent to use the GridLayout layout, and then configure a GridData for the table:

    comp.setLayout(new GridData());
    
    gridData = new GridData();
    gridData.heightHint = 300;
    
    viewer.getTable().setLayoutData(gridData);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called table1 which has a composite primary key using 'ScreenId'
i have a composite key( col1, col2 ) in my table i get the
I have a composite index on three column in one of my table. It
We have a composite primary key for the site table defined below. Functionally, this
Setup : Using PowerBuilder 6.5. I have a composite report (with a report header)
I have a JSF 2 composite component that employs some Ajax behavior. I want
I have compose one small application in which I want to add 20 radio
I have a Composite whose main widget has two children, thus: public MyComposite() {
i want to have some composite-wide keyboard-shortcuts. The composites in question are in a
So I have a class that has a composite primary key: public class Field

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.