Java swing GUI tutorial #21: MiGLayout

preview_player
Показать описание
MigLayout is probably most advanced layout manager for Java GUI's. You can use it for Swing, SWT and JavaFX GUI.

Required jar is in "lib" folder of GitHub project SwingTutorials.

These are some of string keywords which define position and size of your components:

wrap - starts new row

alignx left/right - aligns component horizontaly in left/right side of cell

push/pushx/pushy - forces cell to grow in both/horizontal/vertical direction

grow/growx/growy - forces component to grow in both/horizontal/vertical direction

skip - skips one cell

split - splits single cell to multiple cells (split4 - splits cell to 4 cells)

span - merges multiple cells to single cell

top/bottom - positions component on top/bottom of cell

Note that you can pass multiple keywords.
Regards.
Рекомендации по теме
Комментарии
Автор

Dude, this was a FANTASTIC tutorial. I am up and running with MiGLayout, and I feel like I can do pretty much anything with it. Thank you so much for taking the time to do this tutorial!

bglaze
Автор

Ијао хвала ти брате мили, немаш поима колико ми је ово помогло. Још једном, хвала ти :)

CoolHand
Автор

took me days to finally find this and it was worth it, you rock, thanks much

RemDovans
Автор

Brilliant tutorial. Simple and effective!

venksster
Автор

Good question! In that case, you will have to extract MigLayout jar (using WinRAR for example) and place "net" folder in your projects folder.

OverG
Автор

Finally exactly what i was looking for :D

MegaBlahBlahBlah
Автор

Great instructional video! Keep up the great work!

adambaseball
Автор

Hi. I'd like to thank you. This tutorial was extremly useful. Thank you very much

Автор

Dude this is Awesome tutorial . Its really awesome. Thank you very much.

biswarupadhikari
Автор

If you mean a source code, the answer is no. He will need to add MigLayout library to buildpath. But I don't see any reason why that should make a problem. I personally always work with external libraries (MigLayout, JDBC drivers, look and feel libraries) Just create some folder (like lib) in your project and add your jars there. Create some readme file so you can notify someone else where to look for required jars. Regards.

OverG
Автор

I would put the buttons 'Create' and 'Delete' at the bottom right of the frame. That might look better..
But thanks for the tutorial, it was very helpful :)

physicsimpossible
Автор

where is the most updated official mig layout download

noahd
Автор

I get an error when I compile it after adding the pushx and growx I don't know why... It looks exactly like yours but throws an error.. Is this to do with different versions? Please reply.. :)

physicsimpossible
Автор

thanks for quick reply
if the person who i am giving my files, using Notepad++
where is he supposed to add the library exactly
i am doing my end of the semester project and found your video exactly what i am looking for
but if I am going to use MigLayout I do need to make it clear where to add the jar file

Cybersix
Автор

Cant get it to work with notepad++ :( ...
i know i am asking too much but can you make a video of setting up for something like notepad++ or if you know of a video or page that explains how to do that plz
thanks

Cybersix
Автор

if i give my class to someone else who doesn't have MigLayout, will it work ?
thanks

Cybersix
Автор

I'm watching it in 2022, Is there anyone else that want to learn swing in 2022? (I'm the only stupid one I think)

amirhosseindolatkhah