All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Larry Lustig's user avatar
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">...
Andrea's user avatar
  • 12.6k
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 ...
Anis H's user avatar
  • 1,150
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....
Christian Schnorr's user avatar
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 ...
Max Møller Madsen's user avatar
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?
Evgenij Reznik's user avatar
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 ...
ksm001's user avatar
  • 3,852
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 ...
VoidCatz's user avatar
  • 365
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 ...
matteok's user avatar
  • 2,179
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/...
SHiRKiT's user avatar
  • 1,024
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?
user avatar
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 ...
Massimo's user avatar
  • 966
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 ...
Johannes Wachter's user avatar
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 ...
Jason's user avatar
  • 53
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 ...
android developer's user avatar
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 ...
zed13's user avatar
  • 367
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? ...
Beeraj Jhummun's user avatar
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 ...
Lou's user avatar
  • 117
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 ...
vaniaspeedy's user avatar
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 ...
Christian's user avatar
  • 626
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? ...
Matt's user avatar
  • 3,902
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 ...
Krishna Chalise's user avatar
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 ...
Amanda Healey's user avatar
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); ...
David's user avatar
  • 21
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) ...
Daniel Valencia C.'s user avatar
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 ...
Karen's user avatar
  • 275
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....
user1549397's user avatar
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 ...
David's user avatar
  • 15.9k
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 ...
X Y's user avatar
  • 249
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 ...
Niklas's user avatar
  • 1,211
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 ...
miatech's user avatar
  • 2,188
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 ...
Martin Tuskevicius's user avatar
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 ...
user1319243's user avatar
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 ...
javment's user avatar
  • 368
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 ...
There is nothing we can do's user avatar
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 { ...
Gianluca's user avatar
  • 930
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 ...
arujbansal's user avatar
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 ...
Rapharlo's user avatar
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 ...
Caveman42's user avatar
  • 689
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 ...
Jul's user avatar
  • 1,039
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. ...
marcolopes's user avatar
  • 9,266
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 ...
soneangel's user avatar
  • 621
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 ...
L.U.'s user avatar
  • 511
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 ...
Lechucico's user avatar
  • 1,944
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 ...
Tomáš Zato's user avatar
  • 51.5k
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)
Manu's user avatar
  • 4,470
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 ...
theStackUser45's user avatar
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 ...
hensing1's user avatar
  • 187
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 ...
dave's user avatar
  • 93
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: ...
Stefan Monov's user avatar
  • 11.5k