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
2
votes
2 answers

Adding to a JPanel which uses GroupLayout

I would like to add components (JButton and JSpinner) to a JPanel which was created using Netbeans GUI builder. This panel uses GroupLayout, and I can't seem to use add() to add a component. Is there any way to either add something to a panel which…
2
votes
0 answers

UICollectionViewFlowLayout with different cell sizes unintentionally aligns cells from center

I'm working on an IOS app which requires UICollectionView with different cells with different cell sizes. I sucsessfully implemented the UICollectionView based on those requirements, but for some reason, it made the smaller cells align from…
Nadav96
  • 1,274
  • 1
  • 17
  • 30
2
votes
2 answers

Java Swing: How to remove the default-spacing for JButtons in a JPanel

I'm busy writing a button menu for a Java Swing application and I am wondering if it is possible to remove the padding between JButtons that are added to a JPanel. The JPanel uses a FlowLayout that is aligned left. JPanel panelMenu = new JPanel(new…
TheLovelySausage
  • 3,838
  • 15
  • 56
  • 106
2
votes
1 answer

UICollectionViewCell side-by-side

I have UICollectionView in my custom keyboard, and it has two rows of cells with same heights, but different widths (size comes from server), direction of scroll is horizontal. How can I show collection items side by side, without this strange…
landonandrey
  • 1,271
  • 1
  • 16
  • 26
2
votes
1 answer

New line for JLabel?

I've finished my assignment, I just have one tiny problem. The "title" lines show up in the same row as the rest of the program. Here's how it looks: I need the "Integer Calculation" to be in that line, centered, and everything else under it. Same…
imaginedrragon
  • 303
  • 3
  • 18
2
votes
2 answers

Multiple FlowLayouts in one class?

so I have my Main, and this is done inside of it. JFrame CF = new JFrame(); CF.setLayout(new BorderLayout()); CF.add(new CarGUI(), BorderLayout.NORTH); // CF.add(new CarGUI(), BorderLayout.SOUTH); //' South FlowLayout ' here ^ …
Paramone
  • 2,634
  • 4
  • 31
  • 58
2
votes
1 answer

Make components overlap in flowlayout

I am writing a small card game and so far i have the following : I have a custom JPanel Card component where i override the getPreferredSize() method I also have a custom HandView component which essentially just adds a bunch of card components to…
user2302702
  • 95
  • 1
  • 7
2
votes
1 answer

FlowLayout inside a scrollview

I am creating a flow layout inside the scrollview. Now the issue which I am unable to get my head around is that I want my flowlayout view to be exactly match_parent if the height of the flowlayout is less then the scrollview (which is match_parent)…
Farooq Arshed
  • 1,984
  • 2
  • 17
  • 26
2
votes
1 answer

Put 2 FlowLayouts one under another with a margin

I'm trying to dynamically create 2 FlowLayout instances (one of them has about 50 dynamically created buttons, other has about 10) so that there is a slight gap between them. I'm stuck with this, I tried to use BoxLayout and put flow layouts in it,…
alminh
  • 187
  • 1
  • 15
2
votes
1 answer

FlowLayout alignment changes are not directly visible in Swing

When I change a property of a layout manager of a component which is currently visible in SWING the changes are not made visible. If I resize the entire frame the changes get visible. How to solve this problem? I've experimented with revalidate()…
mythbu
  • 786
  • 1
  • 7
  • 20
2
votes
2 answers

QT Flowlayout - issue with multiline labels

I have a small problem with QT layout. I have a toolbox, and I want to populate it with some checkable buttons with a description. So I create a QWidget with a QGridLayout and put the QButton in the first cell and the QLabel in the second. This is…
frarugi87
  • 2,826
  • 1
  • 20
  • 41
2
votes
3 answers

java- FlowLayout from right to left

FlowLayout adds new component to the right of the last component. I mean it arranges components from left to right(>>>>), but I need the arrangement from right to left(<<<<). is it possible?
Soheil
  • 1,676
  • 7
  • 34
  • 65
2
votes
2 answers

Java FlowLayout Remove Horizontal Space in Front of First Component

Is there an easier way to just remove the horizontal space in front of the first component in FlowLayout? This is basically what my code looked like : JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); JLabel label1 = new…
ghost013
  • 97
  • 1
  • 10
2
votes
4 answers

FlowLayout() of JPanel not displaying JLabels in a flowlayout

I'm a second year CS student (on winter break) and I'm trying to teach myself Swing. Ultimately, this is just a project to add to my portfolio of code and to reinforce what I learned in Data Structures & Algorithms over the semester. However,…
destro
  • 35
  • 4
2
votes
1 answer

Make all but 1 element float left FlowLayout

I've got all my FlowLayout elements set to float left: setLayout(new FlowLayout(FlowLayout.LEFT)); but I want the one on the end (right hand side) to float to the right, how can I make all but one float left?
Crizly
  • 971
  • 1
  • 12
  • 33