All Questions
Tagged with grid-layout layout
97
questions
69
votes
9
answers
63k
views
Why is the Bootstrap grid layout preferable to an HTML table?
[Note: for those who may be confusing this question with "why not use tables for HTML layout", I am not asking that question. The question I'm asking is why is a grid layout fundamentally different ...
47
votes
3
answers
62k
views
CSS grid where one column shrinks to fit content, the other fills the remaning space
I need to create a horizontal layout where one block takes all available space and the other ones shrink to fit their content.
For example:
<div class="grid">
<div class="expand">...
22
votes
6
answers
2k
views
Which layout can do this?
I'm trying to layout some JLabels in my application as shown in this example:
I always have this JLabel at the middle and the number of the others JLabels is variable it can go from 1 to 30. I have ...
11
votes
2
answers
8k
views
CSS3 column layout with dynamic number of columns
I have a set of images that I want to display in the following pattern:
[1] [4] [7] [10] [13]
[2] [5] [8] [11] ...
[3] [6] [9] [12]
I know that I can always manually group 3 images into a div....
8
votes
1
answer
11k
views
PyQT5: Grid layout inside horizontal layout
Can someone help me figure out how to combine layouts?
Taking offset from the guides from: [https://pythonspot.com/en/pyqt5/]
I would rather not use Designer as the layout is going to be a part of ...
8
votes
3
answers
20k
views
Changing width of GridLayout
I use the GridLayout for my JPanel and was wondering, if it's possible to change the width of the columns:
GridLayout grid = new GridLayout(5,2);
panel.setLayout(grid);
Is there a simple way?
7
votes
2
answers
29k
views
Java Swing: How can I change the size of one row in a Grid layout and allow it to resize dynamically only horizontally and not vertically?
Hi everyone I have a JFrame which has three components inside.
A menu
A tabbed pane
a panel that has some buttons
Initially my goal was to create a design like the following:
when the user would ...
7
votes
4
answers
14k
views
Android GridLayout get row/column
I have a 3x3 GridLayout with buttons. These buttons have a onTileClicked() listener. Now I want to get the position of the clicked button in the grid. Here is my code:
public void onTileClicked(View ...
7
votes
3
answers
1k
views
efficiently calculate locations for rectangles in a unit grid
I'm working on a specific layout algorithm to display photos in a unit based grid. The desired behaviour is to have every photo placed in the next available space line by line.
Since there could ...
7
votes
4
answers
2k
views
Align items with different heights in a grid and have them match lines of alignment
I want to create a page where my elements are displayed in a Grid. I want to align the items by line. I want to achieve visually the following result, but I don't know how: https://codepen.io/shirkit/...
6
votes
2
answers
15k
views
What are the parameters for a GridLayout?
private static final GridLayout layout = new GridLayout( 3, 1, 1, 0 );
in this line of code what do the numbers represent and how do you use them to arrange the checkboxes and buttons in the window?
6
votes
2
answers
5k
views
How to using mouse to change size of grid layout cells using Qt?
I use grid layout (horizontal and vertical too). I like the fact that when resizing the window fills the entire window contents. but this extension is poorly managed. I often want to change the size ...
6
votes
1
answer
6k
views
SWT: Nested Layouts with ScrolledComposite exceeds available space
I want to build a Master-Detail layout for one of my applications using SWT.
Container, Content, Sidebar and Part1 are Composite instances.
Scrolled is a ScrolledComposite
The desired layout is ...
5
votes
4
answers
4k
views
How do I neatly indent some components using Java Swing layouts
Using Swing, what is the best way to indent some components underneath a checkbox or radio button? I need to make something in the style of Firefox 3.6's Options->Privacy dialog where some checkboxes ...
5
votes
2
answers
3k
views
Android - WrapPanel equivalent
I've read some of WPF/Silverlight controls, and I really liked some of them. One of the panels that I wish Android could have is WrapPanel (as a layout, of course). Has anyone else come across some ...
3
votes
2
answers
2k
views
Java : divide the screen
I try to do a simple swing window, but with the layout it's not easy...
I mean I just want a window with 3 panels :
header with 20% of window in height
content with 60% of window in height
footer ...
3
votes
2
answers
5k
views
Creating Cells for GridLayout in Java
I'm trying to create a grid for my snakes and ladders game in java, but I have a small problem where there is an unwanted space in the grids I've created
Does anyone know how I can get rid of that?
...
3
votes
1
answer
3k
views
set grid layout column to half the width in android
I have a grid layout with two images in two different columns and the images don't fill all of available space.
I need the both columns to be half the width (as for now the left most one is larger ...
3
votes
1
answer
729
views
Android Layout Hierarchy for checkerboard
I am creating a checkerboard using android views.
The java:
I have a Board object, which contains an array of 64 Cell objects. Each Cell object has a required background image, and an optional ...
2
votes
2
answers
6k
views
Two buttons stretched to full screen on Android [closed]
I thought it would be quite easy, but found no solution for my problem: I only want to have two buttons, one above the other. Both with screen width, both with half screen height, so they fill the ...
2
votes
1
answer
1k
views
Rounded corners on layout
I want my GridLayout to have rounded corners like the 3 Buttons do in the below picture. Does this require code that is different for rounding corners of Views such as Buttons, TextViews, etc?
...
2
votes
1
answer
46
views
GridLayout Displaying 2 rows for `new GridLayout(22,1)`
I am trying to create a scorePanel for a game (Yahtzee). The scorepanel must consists of 22 rows and 1 column for each player but the following code i am writing displays 12 rows and 2 columns for ...
2
votes
1
answer
127
views
Spacing on inside of image in grid
I apologize, I'm sure the solution to this must be on this site somewhere, but I'm not sure what words to search for to find it.
I'm trying to create a grid of images (2 wide x unlimited down) using ...
2
votes
0
answers
150
views
Gridlayout Faulty - I need to replace not add data, and I need horizontal scrolling
here's my code:
public LMSPanel() {
setLayout(new GridLayout(3,3,10,10));
grid = new JLabel [10];
int k = 1;
while (k <= 9) {
grid[k] = new JLabel("", JLabel.LEFT);
...
1
vote
3
answers
210
views
Layout of plots with a unique legend using ggplot
I was trying to create a layout with plots sharing the same legend. The legend is on the top of the first plot, however, the next plot has a different scale. How can I solve this?
library(ggplot2)
...
1
vote
3
answers
1k
views
Using different layouts in GUIs
This is what my program should look like and I'm a bit confused on where I should use different layouts.
I have a Window class which calls the Panel class and the Panel class calls the InputPanel ...
1
vote
1
answer
6k
views
How to set the size of a gridlayout jpanel
I'm trying to set the size of a gridlayout jpanel. Here is the code:
JFrame myFrame = new JFrame();
myFrame.setLayout(new FlowLayout());
myFrame.setLocation(400, 100);
myFrame....
1
vote
1
answer
4k
views
GridLayout not resizing to fit components
The grid layout has two columns and is giving 50% space to each side, no matter what size the components actually are. SetPrefferedSize doesn't seem to work either - but I shouldn't need it, this ...
1
vote
1
answer
128
views
Layout problems with Java Swing Tools
I am trying to make a simple GUI registration code window, that has a text to enter the code, and a button to verify if the code entered is right or wrong. Exactly like this image :
So I tried to do ...
1
vote
1
answer
805
views
Creating breakpoints using the Polymer app-grid layout
The app-grid Element (helper class)in Polymer allows to create a responsive grid layout. The given Polymer Example creates a layout with three list items placed horizontally next to each other.
To ...
1
vote
1
answer
819
views
Panels overlap each other when box not big enough
I have this gui; and when the height is not big enough the panes will overlap each other. I have to set it at least 200, so I can completely see the two rows; but when it is set at 200, then I have ...
1
vote
3
answers
6k
views
Java: forcing a component to fill up the entire row in a GridLayout
I am writing a program that allows multiple users the share screenshots. Every time a user connects, everyone who is participating in the "room" (a bunch of users that are able to receive screen shots ...
1
vote
1
answer
499
views
Elements in Layouts in Java all in same position
I'm coding in Java Swing and for some reason, when I add two elements to a gridlayout, they both assume the same position. I have tried simplifying it into something that would not fail and then ...
1
vote
1
answer
1k
views
java GridLayout component size
I want to make a JPanel (with GridLayout) that contains a grid of custom components. All is ok, but I have problem with the components size. The components size each time grows or diminishes so the ...
1
vote
3
answers
3k
views
How to add JButton to GridLayout?
If I have code like so:
class X extends JFrame
{
X()
{
setLayout(new GridLayout(3,3));
JButton b = new JButton("A-ha");
/*I would like to add this button in the center of this grid (2,2)*/
//How can ...
1
vote
1
answer
34
views
Center div with items laid out using grid on mobile version
I have the following code:
function seeMore() {
window.location("https://inderatech.com/index.html")
}
.see-more {
display: table;
margin-right: auto;
margin-left: auto;
}
.avatar {
...
1
vote
3
answers
2k
views
GridLayout Constraints not working
I have made a gridLayout with column and row counts set to 3 each. When I copy and paste the code for X (I am going to make tic tac toe) it overflows and does not change rows whereas in the emulator ...
1
vote
1
answer
71
views
Panel over a GridLayout Panel
Is it possible to show a Panel (e.g. Panel-A which is nearly transparent) over a panel that has a GridLayout of images?
JPanel mainPanel = new JPanel(new BorderLayout());
JPanel gridOfImages = new ...
1
vote
2
answers
1k
views
re-sizing textfields in GridLayout
I'm kinda new to java swing and I'm trying to do this by hand for practice. In the following example, I have a setup where I have a GridLayout to display fields the way I want. But I need to re-size ...
1
vote
2
answers
1k
views
Which layout should I use so my app looks like Google Plus?
I'd like to make a layout similar to the one used in the current version of Google Plus:
I don't know which layout I must use because :
- I can't use a GridView because it doesn't support spanning ...
1
vote
1
answer
7k
views
SWT: GridLayout column span
I've been using SWT for a few years, but i can't seem to figure this one out:
I need to SPLIT a VIEW into 2 "zones": LEFT and RIGHT
So i use a Composite with GridLayout with 2 columns to do it.
...
1
vote
2
answers
7k
views
How can I set a JPanel maximum or preferred size that uses gridLayout?
I had problem using a very simple frame containing two JPanel.
The problem is on the layout of the Center JPanel that contains four JButton.
How can I set a better size for buttons or directly for ...
1
vote
1
answer
55
views
Align the cell heights for text items parsed from an API dynamically across multiple columns in React Native
I have three string items pulled from an external location with varying lengths. I’d like items in each row to align with one another. Also, I’d like the height of each item to reflect the length of ...
1
vote
1
answer
1k
views
RecycleView + grid with different image size
I would like to do something like the following image:
As you can see, there's a gridlayout with two columns per row.
Inside each column, there is an image (that should fit different depending on ...
1
vote
1
answer
1k
views
Instead of equal width, could elements in my GridLayout take only as much space as needed?
I have such JPanel:
container = new JPanel();
container.setLayout(new GridLayout(1, 1));
In this panel, I put JLabel and JTextField to create classical form. It renders like this:
Obviously, I'd ...
1
vote
1
answer
307
views
Offset divs in a grid layout
I'm new to grid layout, and I wonder what is the best way to make things exit the grid a little bit, for a "ribbon" effect for instance :
(image from http://www.red-team-design.com/css-ribbons)
1
vote
0
answers
24
views
CSS grid set each cell size to its content's height [duplicate]
Hi iam trying to achieve this kind of stlye ->
But my code keeps the card rows seperted. meaning the row is taking its biggest elements height and putting it in all of its cells. so i get this ...
1
vote
0
answers
46
views
How do I re-initialize a panel with a GridLayout?
I'm writing a small Calendar application which lets my manage important dates and events of my study. I'm working with java.awt.
A single month is drawn onto a panel with a 7*7 BorderLayout. When the ...
1
vote
1
answer
854
views
Maya Python: GridLayout - Different width per Cell
So i am trying to figure out how to have a gridlayout in maya, where 2 cells in the same row vary in width.
i tried indexing the cells in the cellWidth flag, but with no success.
this is what i have ...
1
vote
1
answer
317
views
Qt Quick: Putting Repeater and standalone item in GridLayout leads to weird behavior
My code:
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.3
Window {
visible: true
width: 640
height: 480
GridLayout {
id: grid
anchors.fill: ...