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

How can I make MiGLayout behave like Wrap Layout?

I'd like to replicate the example shown here: Wrap Layout Using MiGLayout. I have tried some combinations, but I'm having a hard time making the buttons wrap automatically to new rows as the container shrinks. Could someone please provide a working…
Datoraki
  • 1,173
  • 11
  • 26
6
votes
1 answer

How to prevent MigLayout from exceeding a container's bounds

I'm trying to construct a simple status panel using MigLayout as follows: setLayout(new MigLayout("fillx", "[][p]")); // removing constructor args makes no difference add(createStatusLabel(), "span 2, wrap"); add(createProgressBar(), "growx,…
zorgbargle
  • 720
  • 11
  • 16
6
votes
1 answer

Get layout constraints for a component in Java Swing

Below is a mock up of code that I've been working on. public class Pane { private final JPanel pane; private JPanel namePanel; private final JTextField panIdField; public Pane() { pane = new JPanel(); …
TheKojuEffect
  • 17,034
  • 16
  • 77
  • 113
5
votes
2 answers

Dynamically removing component from JPanel

Here is runnable piece of code explaining the problem - I can remove s1 and s2 but not s3. This does not seem MigLayout related (I happen to be using it) as I see the same behavior with default layout as well. import…
Amol Katdare
  • 6,484
  • 2
  • 30
  • 36
5
votes
3 answers

How do I shrink a Miglayout row height to zero when I hide components

I have a simple Miglayout dialog with rows consisting of JLabels and JTextFields. The visiblility of a number of the components is set depending on the circumstances. However, when they are hidden the row height remains the same leaving a blank…
PeteBrew
  • 434
  • 2
  • 14
5
votes
1 answer

How do I use MiG Layout with Eclipse?

I've been Googling and checking on Stack Overflow and nothing has helped... hopefully someone can. I usually just write my code by hand, but I'm working on a Java project that has a GUI aspect and I like what MiG Layout has to offer so I want to use…
Josh Leitzel
  • 14,093
  • 12
  • 57
  • 76
5
votes
1 answer

Force MigLayout shrink like GridBagLayout for hidden Objects

I am trying to replace GridBagLayout with MigLayout. The problem is that if i call obj.setVisible(false) for some object in GridBaglayout, the layout shrinks. But in MigLayout it just remains hidden. Do you know some way to make MigLayout acting…
AvrDragon
  • 6,359
  • 3
  • 21
  • 39
5
votes
2 answers

JCombobox dropdown visibility issue?

I have a root panel (2 rows, 1 column) which has panel P and a label L in it. P has a JComboBox B in it. Whenever I click on B, the resulting dropdown shows-up behind L. How do I fix this? I played around with all sorts of setComponentZOrder() but I…
pathikrit
  • 29,060
  • 33
  • 127
  • 206
5
votes
2 answers

How to draw a separator across a panel using MigLayout

This is a MigLayout-newbie question. I'd like to know how to draw a separator from the end of a label across the width of a panel. Here's my example code: package com.ndh.swingjunk; import java.awt.*; import javax.swing.*; import…
Nathan Hughes
  • 85,411
  • 19
  • 161
  • 250
5
votes
4 answers

Line wrap in a JTextArea causes JScrollPane to missbehave with MiGLayout

I am having trouble with the same thing as this guy: MigLayout JTextArea is not shrinking when used with linewrap=true and I used the solution described in one of the answers; to set the minimum size explicitly. This works fine if one places the…
Datoraki
  • 1,173
  • 11
  • 26
5
votes
1 answer

Remove gap to Parent Containers Border in Miglayout

first a picture for visualizing the problem As you can see, there is a huge gap to the parents container on the right and left side of the panel with the arrows, which should not be there. I do not have a clue how to remove the gap. I'm struggling…
Dominik Obermaier
  • 5,082
  • 4
  • 31
  • 45
5
votes
1 answer

How to update/refresh JPanel on JButton click?

I am trying to plot a graph and graph should display when JButton is clicked. To create data set, I am taking some value through JTextField and then created a chart and plotted it. I've got 2 problems: The chart becomes visible after resizing the…
Ranjeet
  • 322
  • 1
  • 4
  • 13
5
votes
3 answers

Java Swing MigLayout, centering two elements inside a spanned row

I'm working on a MigLayout form with 3 columns and 4 rows, like this: "wrap 3", "[15%] 15px [45%] 15px [40%]", "20 [] 15 [] 15 [grow,fill] 15 []" Now my goal is to have it look like this: .------------------------------------. | 15% | 45% …
Fuu
  • 3,298
  • 4
  • 29
  • 48
5
votes
1 answer

Setting width with miglayout

I'm trying to lay out components and want to set the width in a specific way. From what i understand, miglayout sets width like "width min:pref:max". So in my case i want the following: My problem is with comp2. It stops growing after about 200px…
Goatcat
  • 1,053
  • 2
  • 12
  • 31
5
votes
1 answer

How to force a component to grow in MigLayout in Java

I have a component that is made up of various components such as a checkbox a slider and some buttons. i want to add this to a scrollpane and have the slider grow to fill all the remaining space. This is no problem as this code demonstrates : …
Savvas Dalkitsis
  • 11,033
  • 14
  • 61
  • 102
1
2
3
25 26