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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:46:38+00:00 2026-06-10T13:46:38+00:00

Lets say if I have a GridLayout composite with column = 1. (Something like

  • 0

Lets say if I have a GridLayout composite with column = 1. (Something like a vertical flow layout)

I have added Label 1, Label 2, Label 3 to this composite, and they will appear accordingly.

----------
Label 1  |
Label 2  |
Label 3  |
----------

So is it possible that if I set the visibility of Label 2 to be false, can Label 3 move up to replace Label 2? And if Label 2 visibility is set back to true, Label 3 will move down?

  • 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-10T13:46:40+00:00Added an answer on June 10, 2026 at 1:46 pm

    A very simple solution could use GridData::exclude property. For example,

    Code

    import org.eclipse.swt.SWT;
    import org.eclipse.swt.layout.GridData;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Shell;
    
    public class HideLabel 
    {
        public static void main(String[] args)
        {
            Display display = new Display();
            final Shell shell = new Shell(display);
            shell.setLayout(new GridLayout(1, false));
            shell.setText("Hide Label");
    
            Label label = new Label(shell, SWT.NONE);
            label.setText("Label 1");
    
            final Label bHidden = new Label(shell, SWT.NONE);
            bHidden.setText("Label 2");
            GridData data = new GridData();
            data.exclude = false;
            data.horizontalAlignment = SWT.FILL;
            bHidden.setLayoutData(data);
    
            label = new Label(shell, SWT.NONE);
            label.setText("Label 3");
    
            Button button = new Button(shell, SWT.CHECK);
            button.setText("hide");
            button.addListener(SWT.Selection, new Listener() {
                public void handleEvent(Event e) {
                    Button b = (Button) e.widget;
                    GridData data = (GridData) bHidden.getLayoutData();
                    data.exclude = b.getSelection();
                    bHidden.setVisible(!data.exclude);
                    shell.layout(false);
                }
            });
            shell.setSize(200, 200);
            shell.open();
            while (!shell.isDisposed()) {
                if (!display.readAndDispatch())
                    display.sleep();
            }
            display.dispose();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Lets say I have a class A that is fairly simple like this -
Lets say I have multiple commands like 5000 which updates some column and row
Lets say I have this SQL statements: ALTER TABLE dbo.[tbl] ALTER COLUMN col1 varchar(300)
Lets say I have a div like this: <div id=test class=sourcecode> Some String </div>
Lets say I have an enumerable source, that looks like this: IEnumerable<string> source =
lets say i have two branches master develop in master i have something like
Lets say I have a p tag like this: <div id = example> <p
Lets say I have an array like this: string [] Filelist = ... I
Lets say I have this data in a file (externalfile.txt) #1#First#/1# #2#Something#/2# #end# I

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.