Questions tagged [flowlayout]

Flow layout places components left to right and then top to bottom, allocating just enough place for each component.

Flow layout is similar to table layout but it allocates just enough width for each component. It has no "columns" because the width of the cells is most often different for every row. The difference between flow and table layout is less obvious when flow layout only has a single row (a quite common case in GUI).

345 questions
4
votes
0 answers

Flow layout issues

I am using this flow layout class to arrange dynamically created TextView in multiple lines but i have got following issues: The height of this layout doesn't behave as WRAP_CONTENT(as shown in image given in the link). I am placing this layout…
4
votes
1 answer

Qt Auto-arrange widgets in layout

I'm new to Qt and have a problem that I haven't been able to solve. What I have is a scroll area that I add widgets to (what the widgets are doesn't matter). Each of the widgets has a static size and they all have the same width (this might be…
Sean Goodwin
  • 303
  • 4
  • 12
4
votes
2 answers

Why am I not able to "draw" on my JFrame?

I am trying to draw on my JFrame, but I can't get my super.paintComponents(g); to work. Also, nothing is drawing on my JFrame when I tell it to in my paintComponent() method. Here is the code: import java.awt.*; import java.awt.event.*; import…
knorberg
  • 462
  • 5
  • 19
4
votes
1 answer

Why does indexPathForItemAtPoint always return nil

I have a UICollectionView contained in an UIViewController that uses a horizontal UICollectionViewFlowLayout. I'm also using a prototype cell created in my UIStoryboard. I want to create a custom paging, so I'm using -…
DrMonkey68
  • 127
  • 11
4
votes
1 answer

Positioning a JLabel (setAlignment not working)

I want to position my image which I have placed inside a JLabel. Here is my code: public Main() { setLayout (new FlowLayout()); image = new ImageIcon(getClass().getResource("title.gif")); image1 = new JLabel(image); …
user1345415
  • 43
  • 4
  • 10
3
votes
2 answers

jQuery UI selectable, with flow selection instead of box selection

I want to use something similar to jQuery UI's Selectable. But it operates strictly on a dragged rectangle, and I want something that operates on a flow layout (like selecting text). As an example, if I go to the Selectable "display as grid" demo,…
Joe White
  • 94,807
  • 60
  • 220
  • 330
3
votes
3 answers

how to add spacing between row and columns in FlowLayout?

I'm migrating FlowLayout from the accompanist library with the native compose v1.4.0. To give spacing between columns and rows we had FlowCrossAxisAlignment and FlowMainAxisAlignment, however now this approach is not available, on the vertical axis…
3
votes
4 answers

How do I set the horizontal gap for just one part of a FlowLayout?

I have a flow layout with three buttons, between the first and second buttons I would like a horizontal gap of 30 and between the second and third buttons I would like a horizontal gap of 10. I tried this: Jpanel panel = new JPanel(new…
Grammin
  • 11,808
  • 22
  • 80
  • 138
3
votes
1 answer

How to make the cursor in a JTextField span multiple rows in FlowLayout?

How can I make the cursor start at the top left of the JTextField? The text just stays centered when I adjust the height with .setPreferredSize(). Here is the code for the fields and buttons. public class GUIWindow extends JFrame{ private…
3
votes
4 answers

Best Swing Layout for 2-dimensional grid of buttons?

I'm trying to create a JDialog like the Symbol dialog in Microsoft Word that you get by choosing Symbol... from the Insert menu. Basically, it's an n x m (n and m are not known until runtime) grid of small buttons. I've got a first version of this…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
3
votes
0 answers

How to scroll UICollectionView cells before animated insert of new cell?

I have a horizontal scrolling UICollectionView to which I want to add multiple cells that will cause a 2 stage animation to occur: UICollectionView scrolls existing cells to the left, showing the empty space where the new cell will appear,…
3
votes
0 answers

Is it possible to restrict specific rows in FlexboxLayoutManager of RecyclerView?

Background I need to create a UI of a details screen, which includes various fields, in a list fashion. This is why I chose to use RecyclerView, because there could be a lot of fields and I don't want that all views will be inflated from start. The…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
3
votes
0 answers

Swift 3 UICollectionView weird spacing between cells

I wanted to create a simple UICollectionView ; one cell which has one label. The cell and label width should increase / decrease based on the width of the text. The spacing between the labels should be 1. I tried to do that with the following code…
Jan Henk
  • 31
  • 3
3
votes
1 answer

How to Create This Layout in CollectionView

Hi i'd like to know how do we implement this layout in collectionview od we need to put images or resize cells i followed this link https://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest but in this they are passing…
iOS Ninja
  • 101
  • 1
  • 13
3
votes
3 answers

Collection View With Fixed Number of Rows and Columns

I have a collection view and would like to maintain a consistent number of rows and columns across multiple devices. On an iPhone 6s Plus, 6 items are displayed, but when viewing the app on an iPhone 5s, only four items are displayed. See my layout…
iOS Ninja
  • 101
  • 1
  • 13