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/

398 questions
6
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,610
  • 4
  • 34
  • 45
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,223
  • 13
  • 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
  • 740
  • 11
  • 16
6
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
  • 360
  • 2
  • 4
  • 13
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
  • 20,103
  • 19
  • 89
  • 125
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,740
  • 2
  • 33
  • 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
  • 15,089
  • 13
  • 59
  • 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
  • 7,139
  • 4
  • 27
  • 42
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
  • 32,469
  • 37
  • 142
  • 221
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
  • 94,330
  • 19
  • 181
  • 276
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,223
  • 13
  • 26
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,424
  • 4
  • 33
  • 49
5
votes
1 answer

MigLayout and vertically centered components

I want to center buttons as shown below: Here is my code: import java.awt.Dimension; import javax.swing.*; import net.miginfocom.swing.MigLayout; public class MigLayoutTest extends JFrame { public static void main(String[] args) { …
hold3n
  • 75
  • 1
  • 3
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,133
  • 2
  • 14
  • 31
1
2
3
26 27