Questions tagged [miglayout]

MiG Layout is a free and open-source layout manager for Java Swing, SWT, JavaFX2, Fantom, Qt and other GUI toolkits.

MiG Layout is a free and open-source layout manager for many GUI toolkits. Its aim is to allow you to create advanced GUI layouts that are maintainable and flexible.

http://www.miglayout.com/

386 questions
31
votes
6 answers

How to use MigLayout?

I read some information about Java layout managers and the recommendation was MigLayout. My problem is, that I didn't found any tutorial or easy step-by-step documentation. So I want to know how this all works, but I don't know how. Hope, it's not…
guerda
  • 21,229
  • 25
  • 89
  • 139
22
votes
6 answers

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 tried Grid layout by choosing a good number of…
imanis_tn
  • 1,110
  • 1
  • 12
  • 32
17
votes
2 answers

Java Vertical Layout?

I need to position a JLabel over some JButtons, vertically, like a game menu. They should all be centered. I already downloaded MigLayout, but I'm not sure how to use that, so I just want a way to position my components vertically and centered,…
Jimmt
  • 782
  • 2
  • 9
  • 28
13
votes
2 answers

Java: MiGLayout: How to use `hidemode`?

I am starting out using MiGLayout for my GUI design, and one of the feature I would need is to show/hide certain components based on the state of other components. I was going to code this myself, when I noticed that one of the Component Constraints…
bguiz
  • 22,661
  • 40
  • 140
  • 226
11
votes
3 answers

How to center a component on a row containing multiple components with MiGLayout

I started using MiGLayout about a month and half ago and everything is simple and works great. There's only one issue I still have that I haven't been able to fix. Let's say I want to have a row that has two buttons on the right-most side and a…
Adam Smith
  • 4,432
  • 8
  • 41
  • 64
11
votes
1 answer

JScrollpane needs to shrink its width

I have a JScrollpane that has a JPanel on the inside (and the panel contains some JLabels). I want resizing the scroll pane to actually change its size (possibly below the preferred size of the inner components), not just the size of the…
Mike
  • 536
  • 1
  • 4
  • 10
11
votes
2 answers

Is MiGLayout going to be included in Java 7?

All I could find so far is this (open) Sun bug/RFE entry with 426 506 votes: http://bugs.sun.com/view_bug.do?bug_id=6530906 It's in third place in the list of RFEs. Tons of people have stated that it will be included in Java 7...but does anyone have…
Epaga
  • 35,261
  • 53
  • 143
  • 239
10
votes
2 answers

MigLayout JTextArea is not shrinking when used with linewrap=true

If I use a JTextArea with MigLayout like this: MigLayout thisLayout = new MigLayout("", "[][grow]", "[]20[]"); this.setLayout(thisLayout); { jLabel1 = new JLabel(); this.add(jLabel1, "cell 0 0"); jLabel1.setText("jLabel1"); } { jTextArea1…
Marcel Menz
  • 1,055
  • 7
  • 17
  • 25
9
votes
1 answer

How to ... with MigLayout

I am trying to create a layout that will looking like: +---+--------+---+ | | | | | | | | +---+ +---+ | | | | | | | | +---+--------+---+ Central cell should be twice as wide as other. I am trying…
user124722
8
votes
6 answers

Painting over the top of components in Swing?

I have a JPanel added to a JViewport, and the panel has several other panels added to it. I'm trying to implement a dragging selection, where you can select more than one component by dragging the mouse. The only problem I'm facing is that the…
rtheunissen
  • 6,831
  • 5
  • 30
  • 60
8
votes
6 answers

Swing - how to mix JTextField and JTextAreas and have same visual appearance?

I am using miglayout to create a form in which there are JTextFields (short input answers) as well as JTextAreas (Longer answers). The problem is twofold. The border placed around a Scrollpane wrapped text area does not match that of a Text…
I82Much
  • 25,421
  • 13
  • 84
  • 117
8
votes
2 answers

What is the difference between push, grow, and fill in MigLayout?

I see that grow and push accept an optional weighting parameter, but apart from that: what is the real difference between grow, fill, and push? The documentation isn't very clear about that.
Gigatron
  • 1,905
  • 5
  • 20
  • 27
7
votes
2 answers

miglayout: can't get right-alignment to work

Something's not right here. I'm trying to get the rightmost button (labeled "help" in the example below) to be right-aligned to the JFrame, and the huge buttons to have their width tied to the JFrame but be at least 180px each. I got the huge button…
Jason S
  • 171,795
  • 155
  • 551
  • 900
7
votes
1 answer

MigLayout push VS grow

What is the difference between these two constraints? From documentation: PUSH - makes the row and/or column that the component is residing in grow with "weight" GROW - Sets how keen the component should be to grow in relation to other component in…
Vladimir Kishlaly
  • 1,752
  • 1
  • 15
  • 24
7
votes
3 answers

MigLayout usage

A question for those familiar with MigLayout sorry couldn't think of a more appropriate name for the question... I'm trying to create a layout that will end up looking like the following: +---------+---------+ | btn1 | btn2 …
pstanton
  • 29,804
  • 23
  • 108
  • 165
1
2 3
25 26