Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

GridLayout grab remaining space problem

Jan Petersen
10 years ago Feb 16, 2012 6:01pm
Marko Grönroos
10 years ago Feb 16, 2012 8:53pm
Jan Petersen
10 years ago Feb 16, 2012 9:33pm
Marko Grönroos
10 years ago Feb 16, 2012 9:58pm
Jan Petersen
10 years ago Feb 16, 2012 10:07pm
Mohammad Wasim Khan
9 years ago Sep 17, 2012 6:51am
Jens Jansson
9 years ago Sep 17, 2012 7:01am

Gridlayout has slots. It has rows and columns. calling grid.addComponent(component, 0, 2, 0, 2) means that it will add the component to the gridlayout into the slot which is at column 0, row 2. having different numbers between the two first numbers and the second two means that the component should take multiple slots in the gridlayout. Check the javadocs.

Mohammad Wasim Khan
9 years ago Sep 17, 2012 7:16am
Mohammad Wasim Khan
9 years ago Sep 17, 2012 7:21am
Jens Jansson
9 years ago Sep 17, 2012 10:48am
As stated in the Javadocs:
Adds a component to the grid in the specified area. The area is defined by specifying the upper left corner (column1, row1) and the lower right corner (column2, row2) of the area. The coordinates are zero-based.

If the area overlaps with any of the existing components already present in the grid, the operation will fail and an GridLayout.OverlapsException is thrown.

Parameters:
component - the component to be added.
column1 - the column of the upper left corner of the area c is supposed to occupy. The leftmost column has index 0.
row1 - the row of the upper left corner of the area c is supposed to occupy. The topmost row has index 0.
column2 - the column of the lower right corner of the area c is supposed to occupy.
row2 - the row of the lower right corner of the area c is supposed to occupy.

Calling addComponent(component, 0, 2, 0, 2) is equivalent to calling addComponent(component, 0, 2).
Calling addComponent(component, 0, 2, 1, 3) means that the component will take the spaces of the cells in 0,2 ; 1,2 ; 0,3 ; 1,3, so four in total.

Last updated on Sep, 17th 2012
Mohammad Wasim Khan
9 years ago Oct 08, 2012 9:48am
Mohammad Wasim Khan
9 years ago Jan 16, 2013 10:35am
Jens Jansson
9 years ago Jan 21, 2013 11:23am

add a ValueChangeListener on the checkbox. In that ValueChangeListener, if value is true, then call setEnabled(false) on all other checkboxes.

Joonas Lehtinen
9 years ago Jan 24, 2013 4:34pm
Quick side-note

Please only post questions once. I deleted the other copies of the this question from other threads.

To get maximum visibility for a new question, I would recommend to post as a new thread instead of continuing a somewhat related thread.