Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Miglayout: Unable to use it with JPanel

JPanel panel = new JPanel();
panel.setLayout(new MigLayout());

This is my code. I am getting the compiler error

The type org.eclipse.swt.widgets.Layout cannot be resolved. It is indirectly referenced from required .class files and The method setLayout(LayoutManager) in the type Container is not applicable for the arguments (MigLayout)

I have configured the Miglayout.jar in my build path. I can see it under -preferences>javabuildpath>libraries

can anyone help me with this.

like image 412
Learner Avatar asked Jan 23 '26 05:01

Learner


1 Answers

For Swing, you probably want to import net.miginfocom.swing.MigLayout, rather than net.miginfocom.swt.MigLayout.

like image 188
trashgod Avatar answered Jan 24 '26 19:01

trashgod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!