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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:41:15+00:00 2026-06-16T03:41:15+00:00

I understand and can use FormLayout, FormData, FormAttachment but I can’t understand how GridLayout,

  • 0

I understand and can use FormLayout, FormData, FormAttachment but I can’t understand how GridLayout, GridData is working. I want to learn using GridLayout and GridData because it’s more like a table, it has a structure and doesn’t depend on other widgets.

I was working as a web developer (front-end, back-end) and I got lost in Java “Grid” structure. How am I supposed to align, move widgets within a cell (horizontal/vertical Aling, hor./vert. Indent)? Like in HTML/CSS: margin, padding, etc. Ex: move a block from left by 100px. (margin-left: 100px), but in Java?

When I was working as a web developer, I created a page (here in Java it’s view), I know how to organize parents and blocks. Can I compare a Composite to a div, like a block element like in HTML/CSS ?

I need to create the following app:

enter image description here

Am I need to use 4 composites?

  • 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-16T03:41:16+00:00Added an answer on June 16, 2026 at 3:41 am

    The following article should shed some light on GridLayout for you:

    Understanding Layouts in SWT

    To achieve something like the form you have there, you would need something like this:

    shell.setLayout(new GridLayout(3, false));
    
    Label title = new Label(shell, SWT.NONE);
    title.setText("My first text editor");
    GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    data.horizontalSpan = 3;
    title.setLayoutData(data);
    
    Label select = new Label(shell, SWT.NONE);
    select.setText("Select a file:");
    data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    select.setLayoutData(data);
    
    Text text = new Text(shell, SWT.BORDER);
    data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    text.setLayoutData(data);
    
    Button button = new Button(shell, SWT.PUSH);
    button.setText("Browse...");
    data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    button.setLayoutData(data);
    
    List result = new List(shell, SWT.BORDER);
    data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.horizontalSpan = 3;
    result.setLayoutData(data);    
    

    The GridData us used to define the behavior of the component within the layout. You can define vertical/horizontal alignment, margins and so on. horizontalSpan is used to tell the layout how many columns the widget will cover.

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

Sidebar

Related Questions

I don't understand why in the url_split function I can use a++ , but
I know that can't use left join in indexed view. but I don't understand
I'm trying to understand amazon php sdk for AWS but I really can't use
I've seen both used but I can't seem to understand when to use each?
I understand I can use decorators and filters, but then wouldn't I have to
As I understand it I can use reverse P/Invoke to call C# from C++.
As I understand it, Crystal Reports can use EntityFramework, is the correct? I'd rather
I don't understand why if I open a project in xcode I can use
I can't understand the process described in documentation. It says to use event: procedure
I don't understand when should we use stream wrapper and socket. Can anyone tell

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.