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

  • Home
  • SEARCH
  • 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 8422787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:33:13+00:00 2026-06-10T03:33:13+00:00

Here is my code which actually does all the GUI work for Domain(right side

  • 0

Here is my code which actually does all the GUI work for Domain(right side contained in the picture attached).In this function What i am doing is I am creating a composite “test” on the “newTabFolder”.Then i am creating ScrolledComposite “sc” on it and then Creating a composite “compositeInTab” on it and after placing all the widgets on “compositeInTab” I am creating a TabItem for placing the composite “test” on it.

public DomainUI(Composite composite, TabFolder newTabFolder, boolean comingFromSelf)
{
    Composite test = new Composite(newTabFolder,SWT.NONE);
    test.setLayout(new FillLayout());
    ScrolledComposite sc = new ScrolledComposite(test, SWT.V_SCROLL|SWT.H_SCROLL);
    final Composite compositeInTab = new Composite(sc, SWT.NONE);
    sc.setExpandHorizontal(true); 
    sc.setExpandVertical(true);
    sc.setMinHeight(compositeInTab.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    sc.setMinWidth(compositeInTab.computeSize(SWT.DEFAULT, SWT.DEFAULT).x);
    sc.setContent(compositeInTab);
    compositeInTab.setLayout(null);
    sc.setAlwaysShowScrollBars(true);

    /*HERE I AM CREATING LABELS AND TEXT FIELDS AND SETTING THEIR BOUNDS*/
    systemCodeLabel = new Label(compositeInTab, 0);
    systemCodeText = new Text(compositeInTab, SWT.BORDER);
    systemCodeLabel.setText("System Code");
    systemCodeLabel.setBounds(350, 60, 100, 15);
    systemCodeText.setBounds(480, 60, 150, 17);
    // CREATION OF LABELS AND TEXTFIELDS ENDED

    // CREATION OF TABLE STARTS
    myTable = new CreateTable(compositeInTab, 1);
    myTable.setBounds(50, 230, 0, 0);
    myTable.table.setSize(myTable.table.computeSize(570, 250));

    //here i filled data in table

    for(int i=0; i<myTable.table.getColumnCount(); i++)
    {
        myTable.table.getColumn(i).pack();
     myTable.table.getColumn(i).setWidth(myTable.table.getColumn(i).getWidth()+10);
    }

    TabItem tabItem1 = new TabItem(newTabFolder, SWT.NONE);
    tabItem1.setText("Domain");
    tabItem1.setControl(test);
    newTabFolder.setBounds(0, 0, 480, 300);
}
  • 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-10T03:33:15+00:00Added an answer on June 10, 2026 at 3:33 am

    It seems to be a matter of layouts. I fiddled around a little bit and managed to get this working:

    public static void main(String[] args)
    {
        Display display = Display.getDefault();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
    
        ScrolledComposite scrollComp = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.H_SCROLL);
        Composite innerComp = new Composite(scrollComp, SWT.NONE);
        innerComp.setLayout(new GridLayout(4, true));
    
        for(int i = 0; i < 32; i++)
            new Button(innerComp, SWT.PUSH).setText("Button");
    
        scrollComp.setMinHeight(innerComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
        scrollComp.setMinWidth(innerComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).x);
        scrollComp.setContent(innerComp);
        scrollComp.setExpandHorizontal(true);
        scrollComp.setExpandVertical(true);
        scrollComp.setAlwaysShowScrollBars(true);
    
        shell.pack();
        shell.open();
    
        shell.setSize(200, 200);
    
        while(!shell.isDisposed())
        {
            if(!display.readAndDispatch())
                display.sleep();
        }
    }
    

    It will show the scrollbars. However, if I change the layout of the shell to a GridLayout, it will not work. Maybe your “combination” of layouts seems to be the problem…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this piece of Open MP code here which performs an integeration of
i have this quick issue please. I have this code here which permits me
I have code like this: Book.list().each { // real code actually does something more
I've been trying to get this code to work for hours! All I need
Here is the code which test in IE8: var stack = []; function test()
Here is jquery code which hides my table cells with the ID of .style2:
Here is my code which checks if the file exists : #include<stdio.h> #include<zlib.h> #include<unistd.h>
Here is my code which is doing the conversion from hex to decimal. The
I have some code here which works perfectly in firefox but not in chrome
I need help with a weird runtime error. Here's the code which gives it:

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.